Skip to content

Commit 4ae8b3d

Browse files
pcaspersjenkins
authored andcommitted
QPR-12370 imply bond spreads in ore minus
1 parent d815415 commit 4ae8b3d

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

OREAnalytics/orea/app/analytic.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,21 @@ void Analytic::buildMarket(const boost::shared_ptr<ore::data::InMemoryLoader>& l
163163
// first build the market if we have a todaysMarketParams
164164
if (configurations().todaysMarketParams) {
165165
try {
166-
// Note: we usually update the loader with implied data, but we simply use the provided loader here
167-
loader_ = loader;
166+
// imply bond spreads (no exclusion of securities in ore, just in ore+) and add results to loader
167+
auto bondSpreads = implyBondSpreads(configurations().asofDate, inputs_, configurations_.todaysMarketParams,
168+
loader, configurations_.curveConfig, std::string());
169+
170+
// Join the loaders
171+
loader_ = boost::make_shared<CompositeLoader>(loader, bondSpreads);
172+
168173
// Check that the loader has quotes
169-
QL_REQUIRE( loader_->hasQuotes(inputs()->asof()),
170-
"There are no quotes available for date " << inputs()->asof());
174+
QL_REQUIRE(loader_->hasQuotes(configurations().asofDate),
175+
"There are no quotes available for date " << configurations().asofDate);
171176
// Build the market
172-
market_ = boost::make_shared<TodaysMarket>(inputs()->asof(), configurations().todaysMarketParams, loader_,
173-
configurations().curveConfig, inputs()->continueOnError(),
174-
true, inputs()->lazyMarketBuilding(), inputs()->refDataManager(),
175-
false, *inputs()->iborFallbackConfig());
177+
market_ = boost::make_shared<TodaysMarket>(
178+
configurations().asofDate(), configurations().todaysMarketParams, loader_, configurations().curveConfig,
179+
inputs()->continueOnError(), true, inputs()->lazyMarketBuilding(), inputs()->refDataManager(), false,
180+
*inputs()->iborFallbackConfig());
176181
// Note: we usually wrap the market into a PC market, but skip this step here
177182
} catch (const std::exception& e) {
178183
if (marketRequired)

0 commit comments

Comments
 (0)