32#include <ql/types.hpp>
63 HistoricalPnlGenerator(
const std::string& baseCurrency,
const QuantLib::ext::shared_ptr<ore::data::Portfolio>& portfolio,
64 const QuantLib::ext::shared_ptr<ScenarioSimMarket>& simMarket,
65 const QuantLib::ext::shared_ptr<HistoricalScenarioGenerator>& hisScenGen,
66 const QuantLib::ext::shared_ptr<NPVCube>&
cube,
67 const set<std::pair<
string, QuantLib::ext::shared_ptr<QuantExt::ModelBuilder>>>& modelBuilders = {},
72 const QuantLib::ext::shared_ptr<HistoricalScenarioGenerator>& hisScenGen,
73 const QuantLib::ext::shared_ptr<EngineData>& engineData,
const Size nThreads,
const Date& today,
74 const QuantLib::ext::shared_ptr<ore::data::Loader>& loader,
75 const QuantLib::ext::shared_ptr<ore::data::CurveConfigurations>& curveConfigs,
76 const QuantLib::ext::shared_ptr<ore::data::TodaysMarketParameters>& todaysMarketParams,
77 const std::string& configuration,
78 const QuantLib::ext::shared_ptr<ScenarioSimMarketParameters>& simMarketData,
79 const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceData =
nullptr,
81 bool dryRun =
false,
const std::string& context =
"historical pnl generation");
87 void generateCube(
const QuantLib::ext::shared_ptr<ScenarioFilter>& filter);
94 const std::set<std::pair<std::string, QuantLib::Size>>& tradeIds)
const;
105 std::vector<QuantLib::Real>
pnl(
const std::set<std::pair<std::string, QuantLib::Size>>& tradeIds)
const;
111 std::vector<QuantLib::Real>
pnl()
const;
119 const std::set<std::pair<std::string, QuantLib::Size>>& tradeIds)
const;
141 const QuantLib::ext::shared_ptr<NPVCube>&
cube()
const;
154 QuantLib::ext::shared_ptr<HistoricalScenarioGenerator>
hisScenGen_;
155 QuantLib::ext::shared_ptr<NPVCube>
cube_;
162 QuantLib::ext::shared_ptr<ore::data::Loader>
loader_;
173 std::function<std::vector<QuantLib::ext::shared_ptr<ValuationCalculator>>()>
npvCalculator_;
QuantLib::ext::shared_ptr< ore::data::CurveConfigurations > curveConfigs_
std::string configuration_
QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > todaysMarketParams_
TradePnlStore tradeLevelPnl(const ore::data::TimePeriod &period, const std::set< std::pair< std::string, QuantLib::Size > > &tradeIds) const
HistoricalPnlGenerator(const string &baseCurrency, const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< HistoricalScenarioGenerator > &hisScenGen, const QuantLib::ext::shared_ptr< EngineData > &engineData, const Size nThreads, const Date &today, const QuantLib::ext::shared_ptr< ore::data::Loader > &loader, const QuantLib::ext::shared_ptr< ore::data::CurveConfigurations > &curveConfigs, const QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > &todaysMarketParams, const std::string &configuration, const QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > &simMarketData, const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceData=nullptr, const IborFallbackConfig &iborFallbackConfig=IborFallbackConfig::defaultConfig(), bool dryRun=false, const std::string &context="historical pnl generation")
QuantLib::ext::shared_ptr< ScenarioSimMarket > simMarket_
std::vector< std::vector< QuantLib::Real > > TradePnlStore
QuantLib::ext::shared_ptr< HistoricalScenarioGenerator > hisScenGen_
TradePnlStore tradeLevelPnl() const
HistoricalPnlGenerator(const std::string &baseCurrency, const QuantLib::ext::shared_ptr< ore::data::Portfolio > &portfolio, const QuantLib::ext::shared_ptr< ScenarioSimMarket > &simMarket, const QuantLib::ext::shared_ptr< HistoricalScenarioGenerator > &hisScenGen, const QuantLib::ext::shared_ptr< NPVCube > &cube, const set< std::pair< string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > &modelBuilders={}, bool dryRun=false)
QuantLib::ext::shared_ptr< ore::data::Portfolio > portfolio_
QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > referenceData_
std::vector< QuantLib::Real > pnl(const ore::data::TimePeriod &period, const std::set< std::pair< std::string, QuantLib::Size > > &tradeIds) const
void generateCube(const QuantLib::ext::shared_ptr< ScenarioFilter > &filter)
ore::data::IborFallbackConfig iborFallbackConfig_
QuantLib::ext::shared_ptr< ValuationEngine > valuationEngine_
TradePnlStore tradeLevelPnl(const std::set< std::pair< std::string, QuantLib::Size > > &tradeIds) const
QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > simMarketData_
std::function< std::vector< QuantLib::ext::shared_ptr< ValuationCalculator > >()> npvCalculator_
bool useSingleThreadedEngine_
ore::data::TimePeriod timePeriod() const
Time period covered by the historical P&L generator.
QuantLib::ext::shared_ptr< ore::data::Loader > loader_
QuantLib::Size indexAsof() const
Get the index of the as of date in the cube.
std::vector< QuantLib::Real > pnl() const
const QuantLib::ext::shared_ptr< NPVCube > & cube() const
std::set< std::pair< std::string, QuantLib::Size > > tradeIdIndexPairs() const
Set of trade ID and index pairs for all trades.
std::vector< QuantLib::Real > pnl(const std::set< std::pair< std::string, QuantLib::Size > > &tradeIds) const
QuantLib::ext::shared_ptr< NPVCube > cube_
QuantLib::ext::shared_ptr< ore::data::EngineData > engineData_
static IborFallbackConfig defaultConfig()
scenario generator that builds from historical shifts
A Market class that can be updated by Scenarios.