Logo
Reference manual - version orea_version
Public Member Functions | List of all members
ValuationEngine Class Reference

Valuation Engine. More...

#include <orea/engine/valuationengine.hpp>

+ Inheritance diagram for ValuationEngine:

Public Member Functions

 ValuationEngine (const QuantLib::Date &today, const QuantLib::ext::shared_ptr< ore::data::DateGrid > &dg, const QuantLib::ext::shared_ptr< analytics::SimMarket > &simMarket, const set< std::pair< std::string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder >>> &modelBuilders=set< std::pair< std::string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder >>>())
 Constructor. More...
 
void buildCube (const QuantLib::ext::shared_ptr< data::Portfolio > &portfolio, QuantLib::ext::shared_ptr< analytics::NPVCube > outputCube, std::vector< QuantLib::ext::shared_ptr< ValuationCalculator >> calculators, bool mporStickyDate=true, QuantLib::ext::shared_ptr< analytics::NPVCube > outputCubeNettingSet=nullptr, QuantLib::ext::shared_ptr< analytics::NPVCube > outputCptyCube=nullptr, std::vector< QuantLib::ext::shared_ptr< CounterpartyCalculator >> cptyCalculators={}, bool dryRun=false)
 Build NPV cube. More...
 
- Public Member Functions inherited from ProgressReporter
void registerProgressIndicator (const QuantLib::ext::shared_ptr< ProgressIndicator > &indicator)
 
void unregisterProgressIndicator (const QuantLib::ext::shared_ptr< ProgressIndicator > &indicator)
 
void unregisterAllProgressIndicators ()
 
void updateProgress (const unsigned long progress, const unsigned long total, const std::string &detail="")
 
void resetProgress ()
 
const std::set< QuantLib::ext::shared_ptr< ProgressIndicator > > & progressIndicators () const
 

Detailed Description

Valuation Engine.

The valuation engine's purpose is to generate an NPV cube. Its buildCube loops over samples->dates->trades and prices the portfolio under all samples and dates.

The number of dates is defined by the DateGrid passed to the constructor. The number of trades is defined by the size of the portfolio passed to buildCube(). The number of samples is defined by the NPVCube that is passed to buildCube(), this can be dynamic.

In addition to storing the resulting NPVs it can be given any number of calculators that can store additional values in the cube.

Constructor & Destructor Documentation

◆ ValuationEngine()

ValuationEngine ( const QuantLib::Date &  today,
const QuantLib::ext::shared_ptr< ore::data::DateGrid > &  dg,
const QuantLib::ext::shared_ptr< analytics::SimMarket > &  simMarket,
const set< std::pair< std::string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder >>> &  modelBuilders = set< std::pair< std::string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder >>>() 
)

Constructor.

Parameters
todayValuation date
dgSimulation date grid
simMarketSimulated market object
modelBuildersmodel builders to be updated

Member Function Documentation

◆ buildCube()

void buildCube ( const QuantLib::ext::shared_ptr< data::Portfolio > &  portfolio,
QuantLib::ext::shared_ptr< analytics::NPVCube outputCube,
std::vector< QuantLib::ext::shared_ptr< ValuationCalculator >>  calculators,
bool  mporStickyDate = true,
QuantLib::ext::shared_ptr< analytics::NPVCube outputCubeNettingSet = nullptr,
QuantLib::ext::shared_ptr< analytics::NPVCube outputCptyCube = nullptr,
std::vector< QuantLib::ext::shared_ptr< CounterpartyCalculator >>  cptyCalculators = {},
bool  dryRun = false 
)

Build NPV cube.

Parameters
portfolioPortfolio to be priced
outputCubeObject for storing the results at trade level (e.g. NPVs, close-out NPVs, flows)
calculatorsCalculators to use
mporStickyDateUse sticky date in MPOR evaluation?
outputCubeNettingSetOutput cube for netting set-level results
outputCptyCubeOutput cube for storing counterparty-level survival probabilities
cptyCalculatorsCalculators for filling counterparty-level results
dryRunLimit samples to one and fill the rest of the cube with random values