Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/swap-rate-helper-tp4506p4507.html
On 02/20/2006 04:38:06 PM,
[hidden email] wrote:
> I have a question about the SwapRateHelper and the way it
> computes the final maturity date for a swap.
> In the function
>
> void SwapRateHelper::setTermStructure(YieldTermStructure* t)
>
> initially the maturity date of the swap (stored in the private
> variable latestDate_) is computed as
>
> latestDate_ = swap_->maturity();
>
> where the maturity of the swap is found in the usual way, i.e. by
> shifting the first fixing date by 2 working days and then shifting it
> again using the swap tenor. For me this is the correct way.
> But then, if QL_USE_INDEXED_COUPON is defined, the maturity date is
> found using the indexed coupon framework.
Marco,
it might be a semantic problem :)
What is (re)computed is not the maturity of the swap---that is always
swap_->maturity() and is computed as you describe. What the code tries
to find out is rather the latest date up to which the term structure
needs to be extended in order to price the swap.
The two things are not the same. Take the example (not implemented, but
it gives the picture in an extreme case) of a 5-years CMS swap paying
the 10-years swap rate: the maturity of the swap is at 5 years, but the
latest date you would need on the curve is at about 15 years.
The same can happen with a swap paying Libor. In your example, the
maturity of the swap is indeed 22 Feb 11. But due to date adjustments,
the last coupon is a bit shorter than six months from its beginning; it
goes from 23 Aug 10 to 22 Feb 11. On the other hand, the fixing of the
Libor rate for that coupon is performed over a period of six months
from 23 Aug 10; therefore, the term structure needs to be extended up
to 23 Feb 11.
Later,
Luigi
----------------------------------------
I'd never join any club that would have the likes of me as a member.
-- Groucho Marx