From: Luigi B. <lui...@gm...> - 2006-02-21 08:25:26
|
On 02/20/2006 04:38:06 PM, mar...@li... wrote: > I have a question about the SwapRateHelper and the way it =20 > computes the final maturity date for a swap. > In the function >=20 > void SwapRateHelper::setTermStructure(YieldTermStructure* t) >=20 > initially the maturity date of the swap (stored in the private > variable latestDate_) is computed as >=20 > latestDate_ =3D swap_->maturity(); >=20 > 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 =20 swap_->maturity() and is computed as you describe. What the code tries =20 to find out is rather the latest date up to which the term structure =20 needs to be extended in order to price the swap. The two things are not the same. Take the example (not implemented, but =20 it gives the picture in an extreme case) of a 5-years CMS swap paying =20 the 10-years swap rate: the maturity of the swap is at 5 years, but the =20 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 =20 maturity of the swap is indeed 22 Feb 11. But due to date adjustments, =20 the last coupon is a bit shorter than six months from its beginning; it =20 goes from 23 Aug 10 to 22 Feb 11. On the other hand, the fixing of the =20 Libor rate for that coupon is performed over a period of six months =20 from 23 Aug 10; therefore, the term structure needs to be extended up =20 to 23 Feb 11. Later, Luigi ---------------------------------------- I'd never join any club that would have the likes of me as a member. -- Groucho Marx |