Re: Building the ZeroRate curve from deposit-futures-irs

Posted by luca ferraro-2 on
URL: http://quantlib.414.s1.nabble.com/Building-the-ZeroRate-curve-from-deposit-futures-irs-tp5625p5627.html

Thanks Ferdinando, now I know a little bit more on finance conventions
and symbology :-) and I also do reproduce at least the first part of the
zero-curve (I still have some problem in the dates corresponding to
futures instruments).

Taking this "rosetta's legend" in my previous message:

1D = overnight
2D = tomorrow-next
3D = spot next

I should describe in QuantLib these deposit (1D, 2D, 3D) as:

// 1D=overnight (fix today, start today, last 1 day)
boost::shared_ptr<RateHelper> d1d(new DepositRateHelper(
     Handle<Quote>(d1dRate),
     1*Days, 0,
     calendar, ModifiedFollowing,
     true, 0, depositDayCounter));
// 2D=tomorrow-next (fix today, start tomorrow, last 1 day)
boost::shared_ptr<RateHelper> d2d(new DepositRateHelper(
     Handle<Quote>(d2dRate),
     1*Days, 1,
     calendar, ModifiedFollowing,
     true, 0, depositDayCounter));
// 3D=spot-next (fix today, start after-tomorrow, last 1 day)
boost::shared_ptr<RateHelper> d3d(new DepositRateHelper(
     Handle<Quote>(d3dRate),
     1*Days, 2,
     calendar, ModifiedFollowing,
     true, 0, depositDayCounter));

Am I correct?


Anyway, if today is 22/11/2007 and I want to obtain the zero-rate curve
starting from tomorrow, should I write the following code ???

   Calendar calendar = Italy();

   Date todaysDate = Date(22, November, 2007);
   Settings::instance().evaluationDate() = todaysDate;

   Integer fixingDays = 1;
   Date settlementDate = calendar.advance(todaysDate, fixingDays, Days);

boost::shared_ptr<PiecewiseYieldCurve<Discount,LogLinear> >
     depoFutSwapTermStructure( new PiecewiseYieldCurve<Discount,LogLinear>(
     settlementDate, depoFutSwapInstruments,
     termStructureDayCounter, tolerance));

std::vector<Date> v = depoFutSwapTermStructure->dates();
for (unsigned i=0; i < v.size();i++) {
     std::cout << "Date: " << v[i].weekday() << ", " << v[i]
     << " rate: " << depoFutSwapTermStructure->
         zeroRate(v[i],termStructureDayCounter,Continuous)
     << std::endl;
}


Setting settlementDate as referenceDate in the PieacewiseYieldCurve,
this code fails to evaluate the first deposit, because says that it has
a date in the past. I should initialize PieacewiseYieldCurve with
todaysDate as referenceDate and obtain the correct dates. So, what's the
point of setting a settlementDate as:
Date settlementDate = calendar.advance(todaysDate, fixingDays, Days);
???

Thank you again for the help.

luca


Ferdinando Ametrano wrote:

> Hi Luca
>
> as far as I know there in no 3D deposit traded on the market, at least
> not in the EUR market.
>
> In the EUR market you can have SN (spot next: fixes today, starts in 2
> working days, lasts 1 day), SW (spot week: fixes today, starts in 2
> working days, lasts 1 week), 2W (2 weeks: fixes today, starts in 2
> working days, lasts 2 weeks), 1M (1 month: fixes today, starts in 2
> working days, lasts 1 months), nM (n month: fixes today, starts in 2
> working days, lasts n months).
>
> You might also have ON (overnight:  fixes today, starts today, lasts 1
> day) and TN (tom-next:  starts tomorrow, lasts 1 day).
>
> The star/end dates must be calculated taking into account holidays and
> market convention (end-of-month, modified following, etc)
>
> Details change for different currencies, e-g- for GBP spot=today, etc
> but the global picture is not altered.
>
> hope it helps
>
> ciao -- Nando


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users