|
From: Peter C. <pca...@vo...> - 2012-05-17 10:43:42
|
Hi,
when pricing a MultiProductComposite consisting of several
MultiStepSwaption objects with different start indices (=fixing times),
I get wrong npvs for all swaptions except the ones with startIndex =
maximum over all start indices of swaptions in the basket. This is
because the swaptions generate cashflows also for evolver steps > their
respective start index.
I believe the MultiStepSwaption code (ql 1.1) should be modified as
follows to avoid this
if (currentIndex_ == startIndex_)
{
genCashFlows[0][0].timeIndex = 0;
genCashFlows[0][0].amount =
(*payoff_)(swapRate) * annuity;
numberCashFlowsThisStep[0] =genCashFlows[0][0].amount !=
0.0 ? 1 : 0 ;
- return true;
}
else
{
numberCashFlowsThisStep[0] =0;
- ++currentIndex_;
- return false;
}
+ ++currentIndex_;
+ return currentIndex_ > startIndex_;
After that change it works fine imo.
Regards
Peter
|