Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VanillaOptionEngineBuilder Class Reference

Abstract Engine Builder for Vanilla Options. More...

#include <ored/portfolio/builders/vanillaoption.hpp>

+ Inheritance diagram for VanillaOptionEngineBuilder:
+ Collaboration diagram for VanillaOptionEngineBuilder:

Public Member Functions

 VanillaOptionEngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes, const AssetClass &assetClass, const Date &expiryDate)
 
QuantLib::ext::shared_ptr< PricingEngine > engine (const string &assetName, const Currency &ccy, const Date &expiryDate, const bool useFxSpot=true)
 
QuantLib::ext::shared_ptr< PricingEngine > engine (const Currency &ccy1, const Currency &ccy2, const Date &expiryDate, const bool useFxSpot=true)
 
- Public Member Functions inherited from CachingOptionEngineBuilder< string, const string &, const Currency &, const AssetClass &, const Date &, const bool >
 CachingOptionEngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes, const AssetClass &assetClass)
 
- Public Member Functions inherited from CachingEngineBuilder< T, U, Args >
 CachingEngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes)
 
QuantLib::ext::shared_ptr< U > engine (Args... params)
 Return a PricingEngine or a FloatingRateCouponPricer. More...
 
void reset () override
 reset the builder (e.g. clear cache) More...
 
- Public Member Functions inherited from EngineBuilder
 EngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes)
 
virtual ~EngineBuilder ()
 Virtual destructor. More...
 
const string & model () const
 Return the model name. More...
 
const string & engine () const
 Return the engine name. More...
 
const set< string > & tradeTypes () const
 Return the possible trade types. More...
 
const string & configuration (const MarketContext &key)
 Return a configuration (or the default one if key not found) More...
 
virtual void reset ()
 reset the builder (e.g. clear cache) More...
 
void init (const QuantLib::ext::shared_ptr< Market > market, const map< MarketContext, string > &configurations, const map< string, string > &modelParameters, const map< string, string > &engineParameters, const std::map< std::string, std::string > &globalParameters={})
 Initialise this Builder with the market and parameters to use. More...
 
const set< std::pair< string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > & modelBuilders () const
 return model builders More...
 
std::string engineParameter (const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
 
std::string modelParameter (const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
 

Protected Member Functions

virtual string keyImpl (const string &assetName, const Currency &ccy, const AssetClass &assetClassUnderlying, const Date &expiryDate, const bool useFxSpot) override
 
- Protected Member Functions inherited from CachingOptionEngineBuilder< string, const string &, const Currency &, const AssetClass &, const Date &, const bool >
QuantLib::ext::shared_ptr< QuantLib::GeneralizedBlackScholesProcess > getBlackScholesProcess (const string &assetName, const Currency &ccy, const AssetClass &assetClassUnderlying, const std::vector< Time > &timePoints={}, const bool useFxSpot=true)
 
- Protected Member Functions inherited from CachingEngineBuilder< T, U, Args >
virtual T keyImpl (Args...)=0
 
virtual QuantLib::ext::shared_ptr< U > engineImpl (Args...)=0
 

Protected Attributes

Date expiryDate_
 
- Protected Attributes inherited from CachingOptionEngineBuilder< string, const string &, const Currency &, const AssetClass &, const Date &, const bool >
AssetClass assetClass_
 
- Protected Attributes inherited from CachingEngineBuilder< T, U, Args >
map< T, QuantLib::ext::shared_ptr< U > > engines_
 
- Protected Attributes inherited from EngineBuilder
string model_
 
string engine_
 
set< string > tradeTypes_
 
QuantLib::ext::shared_ptr< Marketmarket_
 
map< MarketContext, string > configurations_
 
map< string, string > modelParameters_
 
map< string, string > engineParameters_
 
std::map< std::string, std::string > globalParameters_
 
set< std::pair< string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > modelBuilders_
 

Detailed Description

Abstract Engine Builder for Vanilla Options.

Pricing engines are cached by asset/currency

Definition at line 117 of file vanillaoption.hpp.

Constructor & Destructor Documentation

◆ VanillaOptionEngineBuilder()

VanillaOptionEngineBuilder ( const string &  model,
const string &  engine,
const set< string > &  tradeTypes,
const AssetClass assetClass,
const Date &  expiryDate 
)

Definition at line 120 of file vanillaoption.hpp.

122 : CachingOptionEngineBuilder(model, engine, tradeTypes, assetClass), expiryDate_(expiryDate) {}
CachingOptionEngineBuilder(const string &model, const string &engine, const set< string > &tradeTypes, const AssetClass &assetClass)
const string & engine() const
Return the engine name.
const set< string > & tradeTypes() const
Return the possible trade types.
const string & model() const
Return the model name.

Member Function Documentation

◆ engine() [1/2]

QuantLib::ext::shared_ptr< PricingEngine > engine ( const string &  assetName,
const Currency &  ccy,
const Date &  expiryDate,
const bool  useFxSpot = true 
)

Definition at line 124 of file vanillaoption.hpp.

124 {
125 return CachingPricingEngineBuilder<string, const string&, const Currency&, const AssetClass&,
126 const Date&, const bool>::engine(assetName, ccy, assetClass_, expiryDate, useFxSpot);
127 }
CachingEngineBuilder< T, PricingEngine, Args... > CachingPricingEngineBuilder
+ Here is the call graph for this function:

◆ engine() [2/2]

QuantLib::ext::shared_ptr< PricingEngine > engine ( const Currency &  ccy1,
const Currency &  ccy2,
const Date &  expiryDate,
const bool  useFxSpot = true 
)

Definition at line 129 of file vanillaoption.hpp.

130 {
131 return CachingPricingEngineBuilder<string, const string&, const Currency&, const AssetClass&,
132 const Date&, const bool>::engine(ccy1.code(), ccy2, assetClass_, expiryDate, useFxSpot);
133 }
+ Here is the call graph for this function:

◆ keyImpl()

virtual string keyImpl ( const string &  assetName,
const Currency &  ccy,
const AssetClass assetClassUnderlying,
const Date &  expiryDate,
const bool  useFxSpot 
)
overrideprotectedvirtual

Definition at line 136 of file vanillaoption.hpp.

137 {
138 return assetName + "/" + ccy.code() + "/" + to_string(expiryDate);
139 }
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function:

Member Data Documentation

◆ expiryDate_

Date expiryDate_
protected

Definition at line 141 of file vanillaoption.hpp.