|
29 | 29 | #include <orea/engine/valuationengine.hpp> |
30 | 30 | #include <orea/aggregation/dimregressioncalculator.hpp> |
31 | 31 |
|
| 32 | +#include <ored/marketdata/compositeloader.hpp> |
32 | 33 | #include <ored/marketdata/todaysmarket.hpp> |
33 | 34 | #include <ored/marketdata/bondspreadimply.hpp> |
34 | 35 | #include <ored/portfolio/builders/currencyswap.hpp> |
@@ -163,17 +164,21 @@ void Analytic::buildMarket(const boost::shared_ptr<ore::data::InMemoryLoader>& l |
163 | 164 | // first build the market if we have a todaysMarketParams |
164 | 165 | if (configurations().todaysMarketParams) { |
165 | 166 | try { |
166 | | - // Note: we usually update the loader with implied data, but we simply use the provided loader here |
167 | | - loader_ = loader; |
| 167 | + // imply bond spreads (no exclusion of securities in ore, just in ore+) and add results to loader |
| 168 | + auto bondSpreads = implyBondSpreads(configurations().asofDate, inputs_, configurations_.todaysMarketParams, |
| 169 | + loader, configurations_.curveConfig, std::string()); |
| 170 | + |
| 171 | + // Join the loaders |
| 172 | + loader_ = boost::make_shared<CompositeLoader>(loader, bondSpreads); |
| 173 | + |
168 | 174 | // Check that the loader has quotes |
169 | | - QL_REQUIRE( loader_->hasQuotes(inputs()->asof()), |
170 | | - "There are no quotes available for date " << inputs()->asof()); |
| 175 | + QL_REQUIRE(loader_->hasQuotes(configurations().asofDate), |
| 176 | + "There are no quotes available for date " << configurations().asofDate); |
171 | 177 | // 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()); |
176 | | - // Note: we usually wrap the market into a PC market, but skip this step here |
| 178 | + market_ = boost::make_shared<TodaysMarket>( |
| 179 | + configurations().asofDate, configurations().todaysMarketParams, loader_, configurations().curveConfig, |
| 180 | + inputs()->continueOnError(), true, inputs()->lazyMarketBuilding(), inputs()->refDataManager(), false, |
| 181 | + *inputs()->iborFallbackConfig()); |
177 | 182 | } catch (const std::exception& e) { |
178 | 183 | if (marketRequired) |
179 | 184 | QL_FAIL("Failed to build market: " << e.what()); |
|
0 commit comments