|
From: Jose Aparicio-N. <ja...@fr...> - 2008-11-05 07:01:45
|
Hi all, I am failing to create an amortizing notional bond schedule and I am not
sure whether I am misinterpreting the way I have to pass the data or a REQUIRE
is written with the test condition in the reverse direction.
I create the bond:
DayCounter dayCtr = ActualActual();
Real bondFaceVal = 1000000.0;
Real redemption = 100.0;
Date bondMaturity(todaysDate + Period(3, Years));
Schedule scheFix(todaysDate,
bondMaturity,
Period(3,TimeUnit::Months),
TARGET(),
ModifiedFollowing,
ModifiedFollowing,
DateGeneration::Backward,
false);
std::vector<Real> notionls(5, bondFaceVal);
notionls.insert(notionls.end(), 4, bondFaceVal/10.);
notionls.insert(notionls.end(), 4, bondFaceVal/100.);
boost::shared_ptr<AmortizingFixedRateBond> amortFix(
new AmortizingFixedRateBond(0,
notionls, scheFix, std::vector<Rate>(1, 0.05),
dayCtr, ModifiedFollowing,
std::vector<Real>(1, 100.)));
I fail the REQUIRE (line 508 in bond.cpp) at the second notional insertion in
void Bond::calculateNotionalsFromCashflows()
When constructing the bond with a sinking freq I get the same test failure:
boost::shared_ptr<AmortizingFixedRateBond> amortFix(
new AmortizingFixedRateBond(0,
TARGET(), bondFaceVal, todaysDate,
Period(3, Months), Frequency::Monthly, 0.05,
dayCtr, ModifiedFollowing, todaysDate));
Regards
Pepe
|