26#include <boost/make_shared.hpp>
30#include <ql/pricingengines/vanilla/analyticdigitalamericanengine.hpp>
31#include <ql/processes/blackscholesprocess.hpp>
47 :
CachingEngineBuilder(
"BlackScholesMerton",
"AnalyticDigitalAmericanEngine", {
"EquityTouchOption"}) {}
52 virtual string keyImpl(
const string& assetName,
const Currency& ccy,
const string& type)
override {
53 return assetName + ccy.code() + type;
56 virtual QuantLib::ext::shared_ptr<PricingEngine>
engineImpl(
const string& assetName,
const Currency& ccy,
57 const string& type)
override {
58 QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp = QuantLib::ext::make_shared<GeneralizedBlackScholesProcess>(
64 if (type ==
"One-Touch") {
65 engine_ =
"AnalyticDigitalAmericanEngine";
66 return QuantLib::ext::make_shared<QuantLib::AnalyticDigitalAmericanEngine>(gbsp);
67 }
else if (type ==
"No-Touch") {
68 engine_ =
"AnalyticDigitalAmericanKOEngine";
69 return QuantLib::ext::make_shared<QuantLib::AnalyticDigitalAmericanKOEngine>(gbsp);
71 QL_FAIL(
"Unknwon EQ touch option type: " << type);
Abstract template engine builder class.
Abstract template EngineBuilder class that can cache engines and coupon pricers.
QuantLib::ext::shared_ptr< Market > market_
const string & engine() const
Return the engine name.
const string & model() const
Return the model name.
const string & configuration(const MarketContext &key)
Return a configuration (or the default one if key not found)
Engine Builder for EQ Touch Options.
EquityTouchOptionEngineBuilder()
EquityTouchOptionEngineBuilder(const string &model, const string &engine)
virtual string keyImpl(const string &assetName, const Currency &ccy, const string &type) override
virtual QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const string &assetName, const Currency &ccy, const string &type) override
Serializable Credit Default Swap.
Map text representations to QuantLib/QuantExt types.