#162 simpleDuration, modifiedDuration and convexity dont work with Act/Act(ISMA)

None
closed-accepted
None
5
2013-08-21
2013-07-08
Nick Glass
No

In cashflows.cpp simpleDuration, modifiedDuration and convexity don't work with Act/Act(ISMA) because of use of two argument dc.yearFraction. With Act/Act(ISMA) this form of yearFraction will always return 1.0 as the reference period is set equal to the first two arguments.

I have been experimenting with code similar to the loop in the npv routine to extract the coupon reference periods and sum the yearFractions in the duration loop (code attached). This seems to produce the correct result, although I am not convinced how well it will operate if npvDate != settlementDate.

Something similar could probably be done with convexity.

Regards

Nick

1 Attachments

Discussion

  • Nick Glass

    Nick Glass - 2013-07-08

    simpleDuration missing update of lastDate in last attachment.

     
  • Luigi Ballabio

    Luigi Ballabio - 2013-08-21
    • status: open --> closed-accepted
    • assigned_to: Luigi Ballabio
    • Group: -->
     

Log in to post a comment.