@@ -373,7 +373,8 @@ void MarketRiskBacktest::createReports(const ext::shared_ptr<MarketRiskReport::R
373373 if (pnl) {
374374 for (const auto & t : pnlColumns ())
375375 pnl->addColumn (std::get<0 >(t), std::get<1 >(t), std::get<2 >(t));
376- pnl->addColumn (" DiscountSpec" , string ());
376+ pnl->addColumn (" DiscountSpecKey1" , string ());
377+ pnl->addColumn (" DiscountSpecKey2" , string ());
377378 }
378379 }
379380
@@ -383,7 +384,8 @@ void MarketRiskBacktest::createReports(const ext::shared_ptr<MarketRiskReport::R
383384 pnlTrade->addColumn (" TradeId" , string ());
384385 for (const auto & t : pnlColumns ())
385386 pnlTrade->addColumn (std::get<0 >(t), std::get<1 >(t), std::get<2 >(t));
386- pnlTrade->addColumn (" DiscountSpec" , string ());
387+ pnlTrade->addColumn (" DiscountSpecKey1" , string ());
388+ pnlTrade->addColumn (" DiscountSpecKey2" , string ());
387389 }
388390 }
389391}
@@ -458,16 +460,29 @@ void MarketRiskBacktest::addPnlRow(const QuantLib::ext::shared_ptr<BacktestRepor
458460 .add (currency.empty () ? calculationCurrency_ : currency);
459461
460462 // Append DiscountSpec column (from TodaysMarketParameters) if available and applicable
461- std::string discountSpecStr ;
463+ std::string discountSpecStr1 ;
462464 if (todaysmarket_ && key_1.keytype == QuantExt::RiskFactorKey::KeyType::DiscountCurve) {
463465 const auto & discMap = todaysmarket_->mapping (ore::data::MarketObject::DiscountCurve, ore::data::Market::defaultConfiguration);
464466 auto it = discMap.find (key_1.name );
465467 if (it != discMap.end ()){
466- discountSpecStr = it->second ;
467- }
468+ discountSpecStr1 = it->second ;
469+ }
470+ }
471+ if (!discountSpecStr1.empty ())
472+ report.add (discountSpecStr1);
473+ else
474+ report.add (string ());
475+
476+ std::string discountSpecStr2;
477+ if (todaysmarket_ && key_2.keytype == QuantExt::RiskFactorKey::KeyType::DiscountCurve) {
478+ const auto & discMap = todaysmarket_->mapping (ore::data::MarketObject::DiscountCurve, ore::data::Market::defaultConfiguration);
479+ auto it = discMap.find (key_2.name );
480+ if (it != discMap.end ()){
481+ discountSpecStr2 = it->second ;
482+ }
468483 }
469- if (!discountSpecStr .empty ())
470- report.add (discountSpecStr );
484+ if (!discountSpecStr2 .empty ())
485+ report.add (discountSpecStr2 );
471486 else
472487 report.add (string ());
473488}
0 commit comments