ParCoupon and Calendar problem

Posted by Siddharth Sharma-3 on
URL: http://quantlib.414.s1.nabble.com/Subclassing-the-RateHelper-in-Python-tp4133p4136.html

Hello, all.
I have the following funny situation which I don't
know how to fix. I am building a par curve using a
combination of depos and swaps. For the swaps, I am
using a convention of Unadjusted on both the fixed and
the floating legs. However, this causes a problem when
the swap maturity date is on a weekend. I stepped
through the code and found the following in
parcoupon.cpp in the ParCoupon::amount() method:

Date temp =
index_->calendar().advance(accrualEndDate_,
-fixingDays_, Days);

DiscountFactor endDiscount =          
termStructure->discount(index_->calendar().advance(
temp, index_->settlementDays(), Days));

The problem is that the calendar().advance() takes a
default dayCountConvention of Following. The result is
that my end date (temp) becomes the following Monday.
This causes an exception to be thrown when executing
YieldTermStructure::discount(const Date& d,          
                                           bool
extrapolate) due to the checkRange() method failing.

I'd like to know what's the best way to fix this.

thanks in advance
Sid


               
__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/