File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ void HistoricalSimulationVarReport::writeAdditionalReports(
127127 if (riskFactorBreakdown_) {
128128 // The PnL breakdown on risk factors per scenario
129129 QuantLib::ext::shared_ptr<Report> report2 = reports->reports ().at (2 );
130- if (s < riskFactorPnls_.size ()) {
130+ if (s < riskFactorPnls_.size () && countRF_ < 1 ) {
131131 for (const auto & r : riskFactorPnls_[s]) {
132132 report2->next ();
133133 const auto & key = r.first ;
@@ -140,6 +140,7 @@ void HistoricalSimulationVarReport::writeAdditionalReports(
140140 }
141141 }
142142 }
143+ countRF_++;
143144}
144145
145146void HistoricalSimulationVarReport::writeHeader (const ext::shared_ptr<Report>& report) const {
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ class HistoricalSimulationVarReport : public VarReport {
104104 bool includeExpectedShortfall_ = false ;
105105 bool tradePnl_ = false ;
106106 bool riskFactorBreakdown_ = false ;
107+ int countRF_ = 0 ;
107108};
108109
109110} // namespace analytics
You can’t perform that action at this time.
0 commit comments