Calculate duration and modified duration for multi-step coupon bond
Introduced in release: 1.0 Component: US Bonds Purpose:
Calculates actual Macaulay duration, in years, and modified duration for a multi-stepped coupon bond.
Notes:
A maximum of 20 conversion dates is accommodated.
The price input to this routine is the dirty price, which is used as the denominator in the duration equation. If a 0 is input for price, this routine calculates the denominator as the present value of coupon and principal cash flows.
Results:
The variable dur contains the calculated Macaulay duration. The variable mod_dur contains the modified duration. The results are accurate to as many places as supported by double precision values.
Error Conditions:
Returned values should be ignored for a non-zero status. See Errors.