Skip to content

Commit 6ff74f2

Browse files
committed
QPR-13507 bugfix use term specific base correlation
1 parent 8cd6c37 commit 6ff74f2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

OREData/ored/marketdata/basecorrelationcurve.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,7 @@ void BaseCorrelationCurve::buildFromUpfronts(const Date& asof, const BaseCorrela
509509
dpts.push_back(creditCurve->curve());
510510
}
511511

512-
Handle<DefaultProbabilityTermStructure> indexCurve;
513-
Handle<Quote> indexRecovery;
512+
514513
Handle<YieldTermStructure> discountCurve;
515514
// check if curveID has term suffix already (e.g. "RED:ABCDEFGH_5Y"), if so use that, otherwise use term from config
516515
auto p = ore::data::splitCurveIdWithTenor(config.curveID());
@@ -524,7 +523,8 @@ void BaseCorrelationCurve::buildFromUpfronts(const Date& asof, const BaseCorrela
524523
auto indexCreditCurve = getDefaultProbCurveAndRecovery(mappedIndexCurveName);
525524
QL_REQUIRE(indexCreditCurve != nullptr,
526525
"Can not imply base correlation, index credit curve " << indexNameWithTerm << " missing");
527-
526+
discountCurve = indexCreditCurve->rateCurve();
527+
528528
if (config.calibrateConstituentsToIndexSpread()) {
529529
auto curveCalibration = ext::make_shared<QuantExt::CreditIndexConstituentCurveCalibration>(indexCreditCurve);
530530

OREData/ored/utilities/marketdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ indexTrancheBaseCorrelationCurve(const QuantLib::ext::shared_ptr<Market>& market
301301
const std::string& baseCorrelationCurveId, const std::string& configuration) {
302302
Handle<QuantExt::BaseCorrelationTermStructure> curve;
303303
try {
304-
curve = market->baseCorrelation(baseCorrelationCurveId, configuration);
304+
return market->baseCorrelation(baseCorrelationCurveId, configuration);
305305
} catch (const std::exception&) {
306306
DLOG("Could not find base correlation curve " << baseCorrelationCurveId
307307
<< ", fall back on curve id without tenor.");

0 commit comments

Comments
 (0)