Posted by
Luigi Ballabio on
Dec 21, 2009; 2:02pm
URL: http://quantlib.414.s1.nabble.com/Swap-valuation-with-eurodollar-futures-tp1041p1042.html
On Sun, 2009-12-20 at 15:58 -0500,
[hidden email] wrote:
> I used NullCalendar still noticing the rates are not close to
> Fabozzi's numbers. Any suggestions?
Ok, I finally found some time to have a look. Your coupon dates are not
aligned with the futures dates. You're creating the futures on IMM
dates, which means that they go:
from June 15th, 2005 to September 15th, 2005;
from September 21st, 2005 to December 21st, 2005;
from December 21st, 2005 to March 21st, 2006;
from March 15th, 2006 to June 15th, 2006;
from June 21st, 2006 to September 21st, 2006;
from September 20th, 2006 to December 20th, 2006;
from December 20th, 2006 to March 20th, 2007;
from March 21st, 2007 to June 21st, 2007;
from June 20th, 2007 to September 20th, 2007;
from September 19th, 2007 to December 19th, 2007;
from December 19th, 2007 to March 19th, 2008.
To reproduce the rates exactly, the coupon dates should match the above.
Instead, you're creating the leg schedules with January 1st as start
date, which means you'll have coupons from January 1st to April 1st,
from April 1st to July 1st etc. If you change the schedule (for
instance, if you replace:
Date maturity = settlementDate + lenghtInYears*Years;
with:
Date startDate = Date(21,March,2005);
Date maturity = startDate + lenghtInYears*Years;
and create the schedules from startDate to maturity, some of the coupon
dates will match (not all of them, unfortunately, as the IMM dates are
less regular) and so will some of the rates:
Amount: 1.04932e+06-----Rate: 0.0410605-----Days: 92
Amount: 1.0671e+06-----Rate: 0.0417562-----Days: 92
Amount: 1.15014e+06-----Rate: 0.0455-----Days: 91
Amount: 1.18e+06-----Rate: 0.0472-----Days: 90
Amount: 1.25637e+06-----Rate: 0.0491624-----Days: 92
Amount: 1.28544e+06-----Rate: 0.0503-----Days: 92
Amount: 1.30224e+06-----Rate: 0.051517-----Days: 91
Amount: 1.3129e+06-----Rate: 0.0525162-----Days: 90
Amount: 1.38e+06-----Rate: 0.054-----Days: 92
Amount: 1.40604e+06-----Rate: 0.0550191-----Days: 92
Amount: 1.42899e+06-----Rate: 0.0565317-----Days: 91
Amount: 1.45735e+06-----Rate: 0.0576536-----Days: 91
If you set the start date to March 20th or 19th, you'll match other
rates.
Luigi
--
Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away.
-- Antoine de Saint-Exupery
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users