accrualAmount() function within the bond class...

Posted by Toyin Akin on
URL: http://quantlib.414.s1.nabble.com/Problem-within-the-Bond-YieldSolver-class-tp4278p4283.html

Hi,

Within the accuralAmount() function of the Bond class, if one has a Bond
where the settlement date passed in is equal to a coupon payment date and
the QL_TODAYS_PAYMENTS flag is enabled within the config file, I think the
function should return zero.

However right now it returns a whole coupon amount thus the value of the
CleanPrice is incorrect.

I believe if you simply change the

cashFlows_[i]->date() >= settlement

logic to

cashFlows_[i]->date() > settlement

then this should fix it.

Probably the logic reversed for the elseif statement also ( > to >= ).

Toy out.