Skip to content

Commit 52e775e

Browse files
committed
Merge branch 'github_modules' into 'master'
Github modules See merge request qs/ore-github!1
2 parents 2de6d74 + abf87c4 commit 52e775e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

QuantExt/qle/pricingengines/mcmultilegbaseengine.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <qle/cashflows/averageonindexedcoupon.hpp>
2020
#include <qle/cashflows/indexedcoupon.hpp>
2121
#include <qle/cashflows/overnightindexedcoupon.hpp>
22+
#include <qle/cashflows/subperiodscoupon.hpp>
2223
#include <qle/pricingengines/mcmultilegbaseengine.hpp>
2324

2425
#include <ql/cashflows/averagebmacoupon.hpp>
@@ -646,6 +647,17 @@ void McMultiLegBaseEngine::calculate() const {
646647
bmaIndex->forwardingTermStructure()),
647648
bma->gearing(), bma->spread(), bma->referencePeriodStart(), bma->referencePeriodEnd(),
648649
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());
649661
}
650662

651663
// in arrears?

0 commit comments

Comments
 (0)