26#include <boost/make_shared.hpp>
32#include <ql/processes/blackscholesprocess.hpp>
49 virtual string keyImpl(
const Currency& forCcy,
const Currency& domCcy,
const bool flipResults)
override {
50 return forCcy.code() + domCcy.code() + (flipResults ?
"_1" :
"_0");
53 virtual QuantLib::ext::shared_ptr<PricingEngine>
engineImpl(
const Currency& forCcy,
const Currency& domCcy,
54 const bool flipResults)
override {
55 string pair = forCcy.code() + domCcy.code();
57 QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp = QuantLib::ext::make_shared<GeneralizedBlackScholesProcess>(
59 market_->discountCurve(forCcy.code(),
63 return QuantLib::ext::make_shared<QuantExt::AnalyticEuropeanEngine>(gbsp, flipResults);
72 :
CachingEngineBuilder(
"GarmanKohlhagen",
"AnalyticCashSettledEuropeanEngine", {
"FxDigitalOptionEuropeanCS"}) {}
75 virtual string keyImpl(
const Currency& forCcy,
const Currency& domCcy)
override {
76 return forCcy.code() + domCcy.code();
79 virtual QuantLib::ext::shared_ptr<PricingEngine>
engineImpl(
const Currency& forCcy,
const Currency& domCcy)
override {
80 string pair = forCcy.code() + domCcy.code();
82 QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp = QuantLib::ext::make_shared<GeneralizedBlackScholesProcess>(
84 market_->discountCurve(forCcy.code(),
89 return QuantLib::ext::make_shared<QuantExt::AnalyticCashSettledEuropeanEngine>(gbsp);
Abstract template engine builder class.
Abstract template EngineBuilder class that can cache engines and coupon pricers.
QuantLib::ext::shared_ptr< Market > market_
const string & configuration(const MarketContext &key)
Return a configuration (or the default one if key not found)
Engine Builder for European cash-settled FX Digital Options.
virtual QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const Currency &forCcy, const Currency &domCcy) override
virtual string keyImpl(const Currency &forCcy, const Currency &domCcy) override
FxDigitalCSOptionEngineBuilder()
Engine Builder for European FX Digital Options.
virtual string keyImpl(const Currency &forCcy, const Currency &domCcy, const bool flipResults) override
FxDigitalOptionEngineBuilder()
virtual QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const Currency &forCcy, const Currency &domCcy, const bool flipResults) override
Serializable Credit Default Swap.
string conversion utilities