Logo
Reference manual - version orea_version
PnlAnalytic Class Reference

#include <orea/app/analytics/pnlanalytic.hpp>

Inheritance diagram for PnlAnalytic:

Public Member Functions

 PnlAnalytic (const QuantLib::ext::shared_ptr< InputParameters > &inputs, const QuantLib::ext::weak_ptr< ore::analytics::AnalyticsManager > &analyticsManager)
Public Member Functions inherited from Analytic
 Analytic ()
 Constructors.
 Analytic (std::unique_ptr< Impl > impl, const std::set< std::string > &analyticTypes, const QuantLib::ext::shared_ptr< InputParameters > &inputs, const QuantLib::ext::weak_ptr< AnalyticsManager > &analyticsManager, bool simulationConfig=false, bool sensitivityConfig=false, bool scenarioGeneratorConfig=false, bool crossAssetModelConfig=false)
virtual void runAnalytic (const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={})
 Run only those analytic types that are inclcuded in the runTypes vector, run all if the runType vector is empty.
virtual void buildConfigurations (const bool=false)
void setUp ()
void initialise ()
virtual void buildMarket (const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const bool marketRequired=true)
virtual void buildPortfolio (const bool emitStructuredError=true)
virtual void marketCalibration (const QuantLib::ext::shared_ptr< MarketCalibrationReportBase > &mcr=nullptr)
virtual void modifyPortfolio ()
virtual void replaceTrades ()
virtual void enrichIndexFixings (const QuantLib::ext::shared_ptr< ore::data::Portfolio > &portfolio)
virtual bool requiresMarketData () const
const std::string label () const
 Inspectors.
const std::set< std::string > & analyticTypes () const
const QuantLib::ext::shared_ptr< InputParameters > & inputs () const
const QuantLib::ext::weak_ptr< AnalyticsManager > & analyticsManager () const
const QuantLib::ext::shared_ptr< ore::data::Market > & market () const
QuantLib::ext::shared_ptr< MarketImplgetMarket () const
const QuantLib::ext::shared_ptr< ore::data::Portfolio > & portfolio () const
void setInputs (const QuantLib::ext::shared_ptr< InputParameters > &inputs)
void setMarket (const QuantLib::ext::shared_ptr< ore::data::Market > &market)
void setPortfolio (const QuantLib::ext::shared_ptr< ore::data::Portfolio > &portfolio)
std::vector< QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > > todaysMarketParams ()
const QuantLib::ext::shared_ptr< ore::data::Loader > & loader () const
Configurationsconfigurations ()
analytic_reports reports ()
 Analytic results.
void addReport (const std::string &key, const std::string &subKey, const QuantLib::ext::shared_ptr< ore::data::InMemoryReport > &report)
const QuantLib::ext::shared_ptr< ore::data::InMemoryReport > & getReport (const std::string &key, const std::string &subKey)
analytic_npvcubes & npvCubes ()
analytic_mktcubes & mktCubes ()
analytic_stresstests & stressTests ()
QuantLib::ext::shared_ptr< ParSensitivityCubeStream > & parCvaSensiCubeStream ()
const bool getWriteIntermediateReports () const
void setWriteIntermediateReports (const bool flag)
bool match (const std::set< std::string > &runTypes)
 Check whether any of the requested run types is covered by this analytic.
const std::unique_ptr< Impl > & impl ()
std::set< QuantLib::Date > marketDates () const
std::vector< QuantLib::ext::shared_ptr< Analytic > > allDependentAnalytics () const
const Timer & getTimer ()
void startTimer (const std::string &key)
QuantLib::ext::optional< boost::timer::cpu_timer > stopTimer (const std::string &key, const bool returnTimer=false)
void addTimer (const std::string &key, const Timer &timer)

Additional Inherited Members

Public Types inherited from Analytic
typedef std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< ore::data::InMemoryReport > > > analytic_reports
typedef std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< NPVCube > > > analytic_npvcubes
typedef std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< AggregationScenarioData > > > analytic_mktcubes
typedef std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< StressTestScenarioData > > > analytic_stresstests
Protected Attributes inherited from Analytic
std::unique_ptr< Implimpl_
std::set< std::string > types_
 list of analytic types run by this analytic
QuantLib::ext::shared_ptr< InputParametersinputs_
 contains all the input parameters for the run
QuantLib::ext::weak_ptr< AnalyticsManageranalyticsManager_
 the analytics manger, used for sharing analytics
Configurations configurations_
QuantLib::ext::shared_ptr< ore::data::Marketmarket_
QuantLib::ext::shared_ptr< ore::data::Loader > loader_
QuantLib::ext::shared_ptr< ore::data::Portfolio > portfolio_
analytic_reports reports_
analytic_npvcubes npvCubes_
analytic_mktcubes mktCubes_
analytic_stresstests stressTests_
QuantLib::ext::shared_ptr< ParSensitivityCubeStreamparCvaSensiCubeStream_
bool writeIntermediateReports_ = true
Timer timer_

Detailed Description

The P&L Analytic generates a P&L report as main output with the following columns

  • TradeId and
  • Maturity and MaturityTime
  • StartDate and EndDate of the P&L period, referred to as t0 and t1 below
  • NPV(t0)
  • NPV(asof=t0;mkt=t1)
  • NPV(asof=t1;mkt=t0)
  • NPV(t1)
  • PeriodCashFlow: Aggregate of trade flows in the period, converted into the P&L currency below, compounding?
  • Theta: NPV(asof=t1;mkt=t0) - NPV(t0), Cash Flows?
  • HypotheticalCleanPnL: NPV(asof=t0;mkt=t1) - NPV(t0)
  • CleanPnL: NPV(t1) - NPV(t0) + PeriodCashFlow
  • DirtyPnL: NPV(t1) - NPV(t0)
  • Currency

Moreover

  • four corresponding NPV and additional results reports are generated
  • market scenarios used for the two "lagged" NPV calculations are written as reports