Skip to content

Commit 5512620

Browse files
pcaspersjenkins
authored andcommitted
QPR-12561 add inverted fx spot as required quote
1 parent 91be0cc commit 5512620

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

OREData/ored/configuration/yieldcurveconfig.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,15 @@ const vector<string>& YieldCurveConfig::quotes() {
235235
// Check if the segment is a CrossCcyYieldCurveSegment and add the FX spot rate to the
236236
// set of quotes needed for the YieldCurveConfig if it has not already been added.
237237
if (auto xccySegment = QuantLib::ext::dynamic_pointer_cast<CrossCcyYieldCurveSegment>(c)) {
238-
if (!addedFxSpot)
238+
if (!addedFxSpot) {
239239
quotes_.push_back(xccySegment->spotRateID());
240+
// we add the inverted pair as well, because the original pair might get removed from the market
241+
// data loader if both are present in the input market data
242+
if (auto md = boost::dynamic_pointer_cast<FXSpotQuote>(
243+
parseMarketDatum(Date(), xccySegment->spotRateID(), 1.0))) {
244+
quotes_.push_back("FX/RATE/" + md->ccy() + "/" + md->unitCcy());
245+
}
246+
}
240247
}
241248
}
242249
}

0 commit comments

Comments
 (0)