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

European Swaption Engine Builder. More...

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

+ Inheritance diagram for EuropeanSwaptionEngineBuilder:
+ Collaboration diagram for EuropeanSwaptionEngineBuilder:

Public Member Functions

 EuropeanSwaptionEngineBuilder ()
 
- Public Member Functions inherited from SwaptionEngineBuilder
 SwaptionEngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes)
 
- 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
 

Private Member Functions

QuantLib::ext::shared_ptr< PricingEngine > engineImpl (const string &id, const string &key, const std::vector< Date > &dates, const Date &maturity, const std::vector< Real > &strikes, const bool isAmerican, const std::string &discountCurve, const std::string &securitySpread) override
 

Additional Inherited Members

- Protected Member Functions inherited from SwaptionEngineBuilder
string keyImpl (const string &id, const string &key, const std::vector< Date > &dates, const Date &maturity, const std::vector< Real > &strikes, const bool isAmerican, const std::string &discountCurve, const std::string &securitySpread) override
 
- 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 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

European Swaption Engine Builder.

European Swaptions are priced with Black or Bachelier pricing engines, depending on the volatility type provided by Market

Definition at line 57 of file swaption.hpp.

Constructor & Destructor Documentation

◆ EuropeanSwaptionEngineBuilder()

Definition at line 59 of file swaption.hpp.

60 : SwaptionEngineBuilder("BlackBachelier", "BlackBachelierSwaptionEngine", {"EuropeanSwaption"}) {}
SwaptionEngineBuilder(const string &model, const string &engine, const set< string > &tradeTypes)
Definition: swaption.hpp:43

Member Function Documentation

◆ engineImpl()

QuantLib::ext::shared_ptr< PricingEngine > engineImpl ( const string &  id,
const string &  key,
const std::vector< Date > &  dates,
const Date &  maturity,
const std::vector< Real > &  strikes,
const bool  isAmerican,
const std::string &  discountCurve,
const std::string &  securitySpread 
)
overrideprivate

Definition at line 68 of file swaption.cpp.

70 {
71 QuantLib::ext::shared_ptr<IborIndex> index;
72 string ccyCode = tryParseIborIndex(key, index) ? index->currency().code() : key;
73 Handle<YieldTermStructure> yts =
74 discountCurve.empty() ? market_->discountCurve(ccyCode, configuration(MarketContext::pricing))
76 if (!securitySpread.empty())
77 yts = Handle<YieldTermStructure>(QuantLib::ext::make_shared<ZeroSpreadedTermStructure>(
78 yts, market_->securitySpread(securitySpread, configuration(MarketContext::pricing))));
79 Handle<SwaptionVolatilityStructure> svts = market_->swaptionVol(key, configuration(MarketContext::pricing));
80 return QuantLib::ext::make_shared<BlackMultiLegOptionEngine>(yts, svts);
81}
QuantLib::ext::shared_ptr< Market > market_
const string & configuration(const MarketContext &key)
Return a configuration (or the default one if key not found)
bool tryParseIborIndex(const string &s, QuantLib::ext::shared_ptr< IborIndex > &index)
Try to convert std::string to QuantLib::IborIndex.
Handle< YieldTermStructure > indexOrYieldCurve(const QuantLib::ext::shared_ptr< Market > &market, const std::string &name, const std::string &configuration)
Definition: marketdata.cpp:65
+ Here is the call graph for this function: