|
19 | 19 | #include <qle/cashflows/averageonindexedcoupon.hpp> |
20 | 20 | #include <qle/cashflows/indexedcoupon.hpp> |
21 | 21 | #include <qle/cashflows/overnightindexedcoupon.hpp> |
| 22 | +#include <qle/cashflows/subperiodscoupon.hpp> |
22 | 23 | #include <qle/pricingengines/mcmultilegbaseengine.hpp> |
23 | 24 |
|
24 | 25 | #include <ql/cashflows/averagebmacoupon.hpp> |
@@ -646,6 +647,17 @@ void McMultiLegBaseEngine::calculate() const { |
646 | 647 | bmaIndex->forwardingTermStructure()), |
647 | 648 | bma->gearing(), bma->spread(), bma->referencePeriodStart(), bma->referencePeriodEnd(), |
648 | 649 | bma->dayCounter(), false, Date()); |
| 650 | + } else if (auto spc = boost::dynamic_pointer_cast<QuantExt::SubPeriodsCoupon1>(cpn)) { |
| 651 | + auto iborIndex = boost::dynamic_pointer_cast<IborIndex>(spc->index()); |
| 652 | + QL_REQUIRE(iborIndex, "McMultiLegBaseEngine: SubPeriodsCoupon with non-ibor index is not supported."); |
| 653 | + flr = boost::make_shared<IborCoupon>( |
| 654 | + spc->date(), spc->nominal(), spc->accrualStartDate(), spc->accrualEndDate(), spc->fixingDays(), |
| 655 | + boost::make_shared<IborIndex>( |
| 656 | + "proxy-ibor", (spc->accrualEndDate() - spc->accrualStartDate()) * Days, spc->fixingDays(), |
| 657 | + iborIndex->currency(), iborIndex->fixingCalendar(), Following, false, spc->dayCounter(), |
| 658 | + iborIndex->forwardingTermStructure()), |
| 659 | + spc->gearing(), spc->spread(), spc->referencePeriodStart(), spc->referencePeriodEnd(), |
| 660 | + spc->dayCounter(), false, Date()); |
649 | 661 | } |
650 | 662 |
|
651 | 663 | // in arrears? |
|
0 commit comments