MakeVanillaSwap - spot date calculation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

MakeVanillaSwap - spot date calculation

Luigi Ballabio
Hi,
        small problem in MakeVanillaSwap. The spot-date calculation at line 66
goes like:

Natural fixingDays = iborIndex_->fixingDays();
Date referenceDate = Settings::instance().evaluationDate();
Date spotDate = floatCalendar_.advance(referenceDate,
                                       fixingDays*Days);

The problem is, I guess the intent of the above is to get to

iborIndex_->valueDate(referenceDate)

i.e., the spot date for the underlying index. But for a LIBOR, if you
don't specify a floating calendar explicitly, the current code uses
iborIndex_->fixingCalendar()---i.e., the London calendar---and just
advances two days on that neglecting any domestic LIBOR holidays.

Now, I guess in most cases we could fix that by just replacing the
current code with:

Date referenceDate = Settings::instance().evaluationDate();
Date spotDate = iborIndex_->valueDate(referenceDate);

The problem that remains is, what if one specified a floating calendar
explicitly? Should we calculate the spot date based on that calendar, or
should we keep the LIBOR spot date and just use the given calendar to
build the floating-rate schedule? Is there any commonly used convention,
or is this just not a reasonable use case?

Thanks,
        Luigi


--

Greenspun's Tenth Rule of Programming:
Any sufficiently complicated C or Fortran program contains an
ad-hoc, informally-specified bug-ridden slow implementation of
half of Common Lisp.



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users