112 {
114 return;
115
116 std::vector<QuantLib::ext::shared_ptr<ore::data::TodaysMarketParameters>> tmps =
todaysMarketParams();
117 std::set<Date> marketDates;
119 auto mdates = a.second->marketDates();
120 marketDates.insert(mdates.begin(), mdates.end());
121 }
122
123
124 bool requireMarketData = false;
125 for (const auto& tmp : tmps) {
126 if (!tmp->empty())
127 requireMarketData = true;
128 }
129
130 LOG(
"AnalyticsManager::runAnalytics: requireMarketData " << (requireMarketData ?
"Y" :
"N"));
131
132 if (requireMarketData) {
133
134 if (tmps.size() > 0) {
135 LOG(
"AnalyticsManager::runAnalytics: populate loader for dates: " <<
to_string(marketDates));
137 }
138
139 QuantLib::ext::shared_ptr<InMemoryReport> mdReport = QuantLib::ext::make_shared<InMemoryReport>();
140 QuantLib::ext::shared_ptr<InMemoryReport> fixingReport = QuantLib::ext::make_shared<InMemoryReport>();
141 QuantLib::ext::shared_ptr<InMemoryReport> dividendReport = QuantLib::ext::make_shared<InMemoryReport>();
142
151
152 reports_[
"MARKETDATA"][
"marketdata"] = mdReport;
153 reports_[
"FIXINGS"][
"fixings"] = fixingReport;
154 reports_[
"DIVIDENDS"][
"dividends"] = dividendReport;
155 }
156
157
159 LOG(
"run analytic with label '" << a.first <<
"'");
161 LOG(
"run analytic with label '" << a.first <<
"' finished.");
162
163 if (marketCalibrationReport)
164 a.second->marketCalibration(marketCalibrationReport);
165 }
166
168 auto pricingStatsReport = QuantLib::ext::make_shared<InMemoryReport>();
169 ReportWriter(
inputs_->reportNaString())
170 .writePricingStats(*pricingStatsReport,
inputs_->portfolio());
171 reports_[
"STATS"][
"pricingstats"] = pricingStatsReport;
172 }
173
174 if (marketCalibrationReport) {
175 auto report = marketCalibrationReport->outputCalibrationReport();
176 if (report) {
177 if (auto rpt = QuantLib::ext::dynamic_pointer_cast<InMemoryReport>(report))
178 reports_[
"MARKET"][
"todaysmarketcalibration"] = rpt;
179 }
180 }
181
183}
std::vector< QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > > todaysMarketParams()
Analytic::analytic_reports reports_
Write ORE outputs to reports.
virtual void writeMarketData(ore::data::Report &report, const QuantLib::ext::shared_ptr< ore::data::Loader > &loader, const QuantLib::Date &asof, const set< string > "eNames, bool returnAll)
virtual void writeDividends(ore::data::Report &report, const QuantLib::ext::shared_ptr< ore::data::Loader > &loader)
virtual void writeFixings(ore::data::Report &report, const QuantLib::ext::shared_ptr< ore::data::Loader > &loader)
std::string to_string(const LocationInfo &l)