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

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

+ Inheritance diagram for AsianOptionScriptedEngineBuilder:
+ Collaboration diagram for AsianOptionScriptedEngineBuilder:

Public Member Functions

 AsianOptionScriptedEngineBuilder ()
 
QuantLib::ext::shared_ptr< ore::data::Tradebuild (const Trade *trade, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory) override
 
std::string effectiveTradeType () const override
 
- Public Member Functions inherited from DelegatingEngineBuilder
virtual QuantLib::ext::shared_ptr< ore::data::Tradebuild (const ore::data::Trade *, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory)=0
 
virtual std::string effectiveTradeType () const =0
 
 EngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes)
 
- 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
 

Additional Inherited Members

- 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

Definition at line 293 of file asianoption.hpp.

Constructor & Destructor Documentation

◆ AsianOptionScriptedEngineBuilder()

Definition at line 295 of file asianoption.hpp.

296 : DelegatingEngineBuilder("ScriptedTrade", "ScriptedTrade",
297 {"EquityAsianOptionArithmeticPrice", "EquityAsianOptionArithmeticStrike",
298 "EquityAsianOptionGeometricPrice", "EquityAsianOptionGeometricStrike",
299 "FxAsianOptionArithmeticPrice", "FxAsianOptionArithmeticStrike",
300 "FxAsianOptionGeometricPrice", "FxAsianOptionGeometricStrike",
301 "CommodityAsianOptionArithmeticPrice", "CommodityAsianOptionArithmeticStrike",
302 "CommodityAsianOptionGeometricPrice", "CommodityAsianOptionGeometricStrike"}) {}

Member Function Documentation

◆ build()

QuantLib::ext::shared_ptr< ore::data::Trade > build ( const Trade trade,
const QuantLib::ext::shared_ptr< EngineFactory > &  engineFactory 
)
overridevirtual

Implements DelegatingEngineBuilder.

Definition at line 24 of file asianoption.cpp.

24 {
25
26 auto asianOption = dynamic_cast<const ore::data::AsianOption*>(trade);
27
28 QL_REQUIRE(
29 asianOption != nullptr,
30 "AsianOptionScriptedEngineBuilder: internal error, could not cast to ore::data::AsianOption. Contact dev.");
31
32 auto basketOption = QuantLib::ext::make_shared<BasketOption>(
33 asianOption->payCurrency(), std::to_string(asianOption->quantity()), asianOption->strike(),
34 std::vector<QuantLib::ext::shared_ptr<ore::data::Underlying>>(1, asianOption->underlying()), asianOption->option(),
35 asianOption->settlementDate() == QuantLib::Null<QuantLib::Date>()
36 ? ""
37 : ore::data::to_string(asianOption->settlementDate()),
38 asianOption->observationDates());
39
40 basketOption->build(engineFactory);
41
42 return basketOption;
43}
Serializable Asian Option.
Definition: asianoption.hpp:40
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function:

◆ effectiveTradeType()

std::string effectiveTradeType ( ) const
overridevirtual

Implements DelegatingEngineBuilder.

Definition at line 305 of file asianoption.hpp.

305{ return "ScriptedTrade"; }