Skip to content

Commit eee7206

Browse files
pcaspersjenkins
authored andcommitted
QPR-12180 add vol to cf report for duration adjusted cms coupon
1 parent b8770b7 commit eee7206

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

OREAnalytics/orea/app/reportwriter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <qle/cashflows/equitycoupon.hpp>
3939
#include <qle/currencies/currencycomparator.hpp>
4040
#include <qle/instruments/cashflowresults.hpp>
41+
#include <qle/cashflows/durationadjustedcmscoupon.hpp>
4142

4243
#include <ql/cashflows/averagebmacoupon.hpp>
4344
#include <ql/cashflows/indexedcashflow.hpp>
@@ -401,7 +402,11 @@ void ReportWriter::writeCashflow(ore::data::Report& report, const std::string& b
401402
swaptionTenor = cms->swapIndex()->tenor();
402403
qlIndexName = cms->swapIndex()->iborIndex()->name();
403404
usesSwaptionVol = true;
404-
} else if (auto ibor = QuantLib::ext::dynamic_pointer_cast<IborCoupon>(tmp->underlying())) {
405+
}else if(auto cms = boost::dynamic_pointer_cast<DurationAdjustedCmsCoupon>(tmp->underlying())) {
406+
swaptionTenor = cms->swapIndex()->tenor();
407+
qlIndexName = cms->swapIndex()->iborIndex()->name();
408+
usesSwaptionVol = true;
409+
}else if (auto ibor = QuantLib::ext::dynamic_pointer_cast<IborCoupon>(tmp->underlying())) {
405410
qlIndexName = ibor->index()->name();
406411
usesCapVol = true;
407412
}

OREData/ored/portfolio/swap.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ std::string isdaSubProductSwap(const std::string& tradeId, const vector<LegData>
328328
std::string type = legData[i].legType();
329329
if (type == "Fixed" ||
330330
type == "ZeroCouponFixed" ||
331-
type == "Cashflow")
331+
type == "Cashflow"||
332+
type == "CommodityFixed")
332333
nFixed++;
333334
else if (type == "Floating" ||
334335
type == "CPI" ||
@@ -338,7 +339,11 @@ std::string isdaSubProductSwap(const std::string& tradeId, const vector<LegData>
338339
type == "CMSSpread" ||
339340
type == "DigitalCMSSpread" ||
340341
type == "CMB" ||
341-
type == "Equity")
342+
type == "Equity"||
343+
type == "DurationAdjustedCMS"||
344+
type == "FormulaBased"||
345+
type =="CommodityFloating"||
346+
type =="EquityMargin")
342347
nFloating++;
343348
else {
344349
ALOG("leg type " << type << " not mapped for trade " << tradeId);

0 commit comments

Comments
 (0)