Calendar calculations

The majority of the underlying calculations in this section are implemented using the QuantLib open source library.

Year Fraction calculations

Calculte year fraction between two dates, e.g., for computing accrual of a coupon. Uses calcYearFract. Can be directly applied to data in e.g., Azure SQL Database as data arrives or at pre-specified times of the day.

startDate endDate dayCount yearFraction
0 2021-01-01 2022-01-01 Actual360 1.013889
1 2021-01-01 2022-01-01 Actual364 1.002747
2 2021-01-01 2022-01-01 Actual365Fixed 1.000000
3 2021-01-01 2022-01-01 Thirty360 1.000000
4 2021-01-01 2022-01-01 Thirty365 0.986301
5 2021-01-01 2022-01-01 ActualActual 1.000000
6 2021-01-01 2022-01-01 SimpleDayCounter 1.000000
7 2021-01-01 2022-01-01 Business252 0.996032

Growth curve of year fraction for the different day counters:

Copyright: QuantFns 2023. For general information only. Not to be relied for any purpose. Not advice about investment. No warranty of any kind. No liability for any use of this information accepted. Contact: info@quantfns.com