Hi,
I am trying to
calculate NPV of a vanilla swap based in the swapvaluation.cpp code.
I have setup the
swap the following way :
Effective time :
2010-10-01
Termination time :
2020-10-01
Evaluation date is
June 20, 2011 which will have a settlement date on June 22, 2011. The rates used
are :
USDLibor BBA depo
rates from ON to 12 months and several swap rates from 2 years to 30 years. The
fixed payment frequency is annual and floating is semiannual. The calendar used
is TARGET. As shown here the difference is the evaluation date is between the
swap’s effective and termination dates. So when I came to construct the
VanillaSwap, what should I pass for the effective date parameter for the fixed
and floating schedules if the date generation rule is Forward? If I pass
June 22, then the payment dates thus generated will be different from the
original schedule. So I pass the original effective date 2010-10-01 as effective
date. But with this setting, I got an exception in DiscountingSwapEngine::calculate() when it
discounts on each cash flow’s startDate like startDiscounts[i]
= discountCurve_->discount(d) because timeFromReference (referernce date is
June 22, 2011) will be negative.
So what is this startDiscounts are used for in the first place and what should
one setup to evaluate a VanillaSwap on a date between its effective and
termonation time. Should one pass as effective date of the schedule the
immediate cach flow date that is later than the settlement date (June 22, 2011,
this is case)?
Jicun
| Free forum by Nabble | Edit this page |