Re: Day counting offset

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Day-counting-offset-tp3882p3883.html

On 07/06/2005 10:29:11 PM, Guowen Han wrote:

>
> The error message can be removed (suggested by Michelotti Enrico) by
> adding the following statement.
>         myTermStructure->enableExtrapolation();
>
> However the offset is still there, and I got more time points than
> expected. Here is my code, any suggestions are appreciated
>
>     std::vector<Date> dates;
>     dates.push_back(refDate + Period(0, Months));
>     ...
>     dates.push_back(refDate + Period(360, Months));

It's probably a date-adjustment thing. You're passing as the last date  
on the curve the reference date plus 30 years, unadjusted. But that  
date might be a holiday, so the swaption maturity (calculated inside  
the swaption helper) is set one or two days later and falls off the end  
of the term structure.

You can try initializing the curve dates as

std::vector<Date> dates;
Calendar calendar = ...; (the one relevant for your calculation)
dates.push_back(refDate);
dates.push_back(calendar.advance(refDate, Period(1,Months)));
...
dates.push_back(calendar.advance(refDate, Period(360,Months)));

This might push the end of the curve a day or two further, which is the  
lag you need.

Later,
        Luigi

----------------------------------------

The shortest way to do many things is to do only one thing at once.
-- Samuel Smiles