26#include <qle/pricingengines/analyticeuropeanenginedeltagamma.hpp>
27#include <qle/pricingengines/discountingcurrencyswapenginedeltagamma.hpp>
28#include <qle/pricingengines/discountingfxforwardenginedeltagamma.hpp>
29#include <qle/pricingengines/discountingswapenginedeltagamma.hpp>
31#include <boost/make_shared.hpp>
39#include <ql/pricingengines/swap/discountingswapengine.hpp>
57 virtual QuantLib::ext::shared_ptr<PricingEngine>
engineImpl(
const Currency& ccy,
const std::string& discountCurve,
58 const std::string& securitySpread)
override {
63 bool computeBPS =
false;
65 Handle<YieldTermStructure> yts = discountCurve.empty()
68 if (!securitySpread.empty())
69 yts = Handle<YieldTermStructure>(QuantLib::ext::make_shared<ZeroSpreadedTermStructure>(
71 return QuantLib::ext::make_shared<DiscountingSwapEngineDeltaGamma>(yts, bucketTimes, computeDelta,
72 computeGamma, computeBPS);
85 virtual QuantLib::ext::shared_ptr<PricingEngine>
engineImpl(
const std::vector<Currency>& ccys,
86 const Currency& base)
override {
93 std::vector<Handle<YieldTermStructure>> discountCurves;
94 std::vector<Handle<Quote>> fxQuotes;
95 for (Size i = 0; i < ccys.size(); ++i) {
97 string pair = ccys[i].code() + base.code();
100 return QuantLib::ext::make_shared<DiscountingCurrencySwapEngineDeltaGamma>(
101 discountCurves, fxQuotes, ccys, base, bucketTimes, computeDelta, computeGamma, linearInZero,
102 applySimmExemptions);
117 virtual QuantLib::ext::shared_ptr<PricingEngine>
engineImpl(
const string& assetName,
const Currency& ccy,
119 const Date& expiryDate,
const bool useFxSpot)
override {
120 std::vector<Time> bucketTimesDeltaGamma =
126 string pair = assetName + ccy.code();
127 QuantLib::ext::shared_ptr<GeneralizedBlackScholesProcess> gbsp =
130 return QuantLib::ext::make_shared<AnalyticEuropeanEngineDeltaGamma>(
131 gbsp, bucketTimesDeltaGamma, bucketTimesVega, computeDeltaVega, computeGamma);
164 virtual QuantLib::ext::shared_ptr<PricingEngine>
engineImpl(
const Currency& forCcy,
const Currency& domCcy)
override {
172 string pair =
keyImpl(forCcy, domCcy);
173 Handle<YieldTermStructure> domCcyCurve =
175 Handle<YieldTermStructure> forCcyCurve =
179 return QuantLib::ext::make_shared<DiscountingFxForwardEngineDeltaGamma>(
180 domCcy, domCcyCurve, forCcy, forCcyCurve, fx, bucketTimes, computeDelta, computeGamma, linearInZero,
181 boost::none, Date(), Date(), applySimmExemptions);
Engine builder for FX Forwards.
Engine builder for FX Options.
Engine builder for Swaps.
Abstract engine builders for European and American Options.
QuantLib::ext::shared_ptr< QuantLib::GeneralizedBlackScholesProcess > getBlackScholesProcess(const string &assetName, const Currency &ccy, const AssetClass &assetClassUnderlying, const std::vector< Time > &timePoints={}, const bool useFxSpot=true)
Engine Builder base class for Cross Currency Swaps.
Engine Builder for Cross Currency Swaps.
virtual QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const std::vector< Currency > &ccys, const Currency &base) override
CurrencySwapEngineBuilderDeltaGamma()
QuantLib::ext::shared_ptr< Market > market_
const set< string > & tradeTypes() const
Return the possible trade types.
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)
Engine Builder for European Equity Options with analytical sensitivities.
EquityEuropeanOptionEngineBuilderDeltaGamma()
Engine Builder for European Options with delta/gamma extension.
EuropeanOptionEngineBuilderDeltaGamma(const string &model, const set< string > &tradeTypes, const AssetClass &assetClass)
virtual QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const string &assetName, const Currency &ccy, const AssetClass &assetClassUnderlying, const Date &expiryDate, const bool useFxSpot) override
Engine Builder for European FX Options with analytical sensitivities.
FxEuropeanOptionEngineBuilderDeltaGamma()
Engine Builder base class for FX Forwards.
virtual string keyImpl(const Currency &forCcy, const Currency &domCcy) override
Engine Builder for FX Forwards.
virtual QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const Currency &forCcy, const Currency &domCcy) override
FxForwardEngineBuilderDeltaGamma()
Engine Builder base class for Single Currency Swaps.
Engine Builder for Single Currency Swaps.
SwapEngineBuilderDeltaGamma()
virtual QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const Currency &ccy, const std::string &discountCurve, const std::string &securitySpread) override
Abstract Engine Builder for Vanilla Options.
bool parseBool(const string &s)
Convert text to bool.
Real parseReal(const string &s)
Convert text to Real.
Classes and functions for log message handling.
Handle< YieldTermStructure > xccyYieldCurve(const QuantLib::ext::shared_ptr< Market > &market, const string &ccyCode, const string &configuration)
Handle< YieldTermStructure > indexOrYieldCurve(const QuantLib::ext::shared_ptr< Market > &market, const std::string &name, const std::string &configuration)
Serializable Credit Default Swap.