Login  Register

Possible ACT/ACT DayCounter problem

Posted by Toyin Akin on Nov 13, 2005; 8:38pm
URL: http://quantlib.414.s1.nabble.com/bug-report-negative-price-for-an-American-put-option-using-Bjerksund-and-Stensland-approximation-tp4195p4199.html

Hi,

When pricing a swap structure which starts in the past and thus requires a
fixing value for the first period (payment date is after the ValueDate), if
you specify ACTACT as a daycount, the swap will report an error.

This happens, for example, on lines #104 and #130 within the
setupArguments() function call.

This is because the call to yearfraction() within the ACTACT daycounter
class checks to see if the dates passed in are passed in the correct order.
If not it throws an exception.

In the case of this fixing scenario, the dates will be passed in, will be of
the incorrect order because the ValueDate is after the fixing date (line
#130).

However all the other daycounter classes do not check for this. I understand
that the code following the call to yearfraction() would take the correct
action if a negative value is returned (ie - PricingEngines).

Best Regards,
Toyin Akin.