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

Engine Builder for European FX Barrier Options. More...

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

+ Inheritance diagram for FxBarrierOptionEngineBuilder:
+ Collaboration diagram for FxBarrierOptionEngineBuilder:

Protected Member Functions

 FxBarrierOptionEngineBuilder (const string &model, const string &engine)
 
virtual string keyImpl (const Currency &forCcy, const Currency &domCcy, const Date &expiryDate, const Date &paymentDate) override
 
QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > getBlackScholesProcess (const Currency &forCcy, const Currency &domCcy, const std::vector< Time > &timePoints={})
 
- Protected Member Functions inherited from CachingEngineBuilder< T, U, Args >
virtual T keyImpl (Args...)=0
 
virtual QuantLib::ext::shared_ptr< U > engineImpl (Args...)=0
 

Additional Inherited Members

- 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 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

Engine Builder for European FX Barrier Options.

Pricing engines are cached by currency pair

Definition at line 44 of file fxbarrieroption.hpp.

Constructor & Destructor Documentation

◆ FxBarrierOptionEngineBuilder()

FxBarrierOptionEngineBuilder ( const string &  model,
const string &  engine 
)
protected

Definition at line 49 of file fxbarrieroption.hpp.

50 : CachingEngineBuilder(model, engine, {"FxBarrierOption"}) {}
CachingEngineBuilder(const string &model, const string &engine, const set< string > &tradeTypes)
const string & engine() const
Return the engine name.
const string & model() const
Return the model name.

Member Function Documentation

◆ keyImpl()

virtual string keyImpl ( const Currency &  forCcy,
const Currency &  domCcy,
const Date &  expiryDate,
const Date &  paymentDate 
)
overrideprotectedvirtual

Definition at line 52 of file fxbarrieroption.hpp.

53 {
54 return forCcy.code() + "/" + domCcy.code() + "/" + ore::data::to_string(expiryDate) + "/" +
55 ore::data::to_string(paymentDate);
56 }
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function:

◆ getBlackScholesProcess()

QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > getBlackScholesProcess ( const Currency &  forCcy,
const Currency &  domCcy,
const std::vector< Time > &  timePoints = {} 
)
protected

Definition at line 59 of file fxbarrieroption.hpp.

59 {}) {
60 const string& ccyPairCode = forCcy.code() + domCcy.code();
61 Handle<BlackVolTermStructure> vol =
63 if (!timePoints.empty()) {
64 vol = Handle<BlackVolTermStructure>(
65 QuantLib::ext::make_shared<QuantExt::BlackMonotoneVarVolTermStructure>(vol, timePoints));
66 vol->enableExtrapolation();
67 }
68 return QuantLib::ext::make_shared<GeneralizedBlackScholesProcess>(
70 market_->discountCurve(forCcy.code(), configuration(ore::data::MarketContext::pricing)),
71 market_->discountCurve(domCcy.code(), configuration(ore::data::MarketContext::pricing)), vol);
72 }
QuantLib::ext::shared_ptr< Market > market_
const string & configuration(const MarketContext &key)
Return a configuration (or the default one if key not found)
+ Here is the caller graph for this function: