26#include <qle/pricingengines/analyticoutperformanceoptionengine.hpp>
28#include <boost/make_shared.hpp>
33#include <ql/processes/blackscholesprocess.hpp>
50 :
CachingEngineBuilder(
"BlackScholesMerton",
"AnalyticOutperformanceOptionEngine", {
"EquityOutperformanceOption"}) {}
55 virtual string keyImpl(
const string& assetName1,
const string& assetName2,
const Currency& ccy)
override {
56 return assetName1 + assetName2 + ccy.code();
59 virtual QuantLib::ext::shared_ptr<PricingEngine>
engineImpl(
const string& assetName1,
const string& assetName2,
const Currency& ccy)
override {
60 QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp1 = QuantLib::ext::make_shared<GeneralizedBlackScholesProcess>(
66 QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp2 = QuantLib::ext::make_shared<GeneralizedBlackScholesProcess>(
74 QuantLib::Handle<QuantExt::CorrelationTermStructure> corrCurve(
75 QuantLib::ext::make_shared<QuantExt::FlatCorrelation>(0, NullCalendar(), 0.0, Actual365Fixed()));
77 corrCurve =
market_->correlationCurve(
"EQ-" + assetName1,
"EQ-" + assetName2,
80 WLOG(
"no correlation curve for EQ-" << assetName1 <<
", EQ-" << assetName2
81 <<
" found, fall back to zero correlation.");
84 engine_ =
"AnalyticOutperformanceOptionEngine";
85 return QuantLib::ext::make_shared<QuantExt::AnalyticOutperformanceOptionEngine>(gbsp1, gbsp2, corrCurve, integrationPoints);
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.
std::string engineParameter(const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
const string & configuration(const MarketContext &key)
Return a configuration (or the default one if key not found)
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
#define WLOG(text)
Logging Macro (Level = Warning)
Serializable Credit Default Swap.
Map text representations to QuantLib/QuantExt types.