29 const map<string, string>& equities) {
30 for (
const auto& div :
csvLoader_->loadDividends()) {
31 for (
const auto& it : equities) {
32 if (div.name == it.second)
33 loader->addDividend(div);
39 const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader,
40 const map<Date, set<string>>& quotes,
41 const Date& requestDate) {
46 loader->add(
inputs_->asof(), md->name(), md->quote()->value());
48 for (
const auto& qd : quotes) {
50 for (
const auto& q : qd.second) {
55 QuantLib::ext::shared_ptr<MarketDatum> datum =
csvLoader_->get(q, d);
56 loader->add(d, datum->name(), datum->quote()->value());
58 LOG(
"Requested quote " << q <<
" for date " << d
59 <<
" not in csv file. This is not necessarily an error.");
66 loader->add(d, md->name(), md->quote()->value());
76 map<pair<string, Date>, set<Date>> lastAvailableFixingLookupMap) {
78 LOG(
"MarketDataCsvLoader::retrieveFixings called: all fixings ? " << (
inputs_->allFixings() ?
"Y" :
"N"));
81 for (
const auto& f :
csvLoader_->loadFixings()) {
82 loader->addFixing(f.date, f.name, f.fixing);
89 for (
const auto& [
name, fixingDates] : fixings) {
92 for (
const auto& [date, mandatory] : fixingDates) {
94 for (
const auto& fix :
csvLoader_->loadFixings()) {
95 if (fix.name ==
name && fix.date == date) {
97 loader->addFixing(fix.date, fix.name, fix.fixing);
105 for (
const auto& fp : lastAvailableFixingLookupMap) {
106 if (loader->getFixing(fp.first.first, fp.first.second).empty()) {
107 set<Date>::reverse_iterator rit;
108 for (rit = fp.second.rbegin(); rit != fp.second.rend(); rit++) {
109 auto f = loader->getFixing(fp.first.first, *rit);
111 loader->addFixing(fp.first.second, fp.first.first, f.fixing);
115 WLOG(
"MarketDataCsvLoader::retrieveFixings(::load Could not find fixing for id " << fp.first.first <<
" on date "
116 << fp.first.second <<
". ");
void retrieveMarketData(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const ore::analytics::QuoteMap "es, const QuantLib::Date &requestDate=QuantLib::Date()) override
retrieve market data
void retrieveFixings(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, ore::analytics::FixingMap fixings={}, std::map< std::pair< std::string, QuantLib::Date >, std::set< QuantLib::Date > > lastAvailableFixingLookupMap={}) override
retrieve fixings
void loadCorporateActionData(QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::map< std::string, std::string > &equities) override
load corporate action data
QuantLib::ext::shared_ptr< ore::data::CSVLoader > csvLoader_
QuantLib::ext::shared_ptr< InputParameters > inputs_
bool matches(const std::string &s) const
std::map< std::string, RequiredFixings::FixingDates > FixingMap