28#include <ql/cashflows/couponpricer.hpp>
29#include <ql/cashflows/cpicouponpricer.hpp>
30#include <ql/indexes/inflationindex.hpp>
45 virtual string keyImpl(
const string& indexName)
override {
return indexName; }
46 virtual QuantLib::ext::shared_ptr<QuantLib::InflationCouponPricer>
engineImpl(
const string& indexName)
override {
47 Handle<QuantLib::CPIVolatilitySurface> vol =
49 Handle<ZeroInflationIndex> cpiIndex =
51 std::string ccyCode = cpiIndex->currency().code();
52 Handle<YieldTermStructure> discountCurve =
55 bool useLastFixingDate =
61 return QuantLib::ext::make_shared<QuantExt::BlackCPICouponPricer>(vol, discountCurve, useLastFixingDate);
63 return QuantLib::ext::make_shared<QuantExt::BachelierCPICouponPricer>(vol, discountCurve, useLastFixingDate);
76 virtual string keyImpl(
const string& indexName)
override {
return indexName; }
77 virtual QuantLib::ext::shared_ptr<QuantExt::InflationCashFlowPricer>
engineImpl(
const string& indexName)
override {
78 Handle<QuantLib::CPIVolatilitySurface> vol =
80 Handle<ZeroInflationIndex> cpiIndex =
82 std::string ccyCode = cpiIndex->currency().code();
83 Handle<YieldTermStructure> discountCurve =
86 bool useLastFixingDate =
92 return QuantLib::ext::make_shared<QuantExt::BlackCPICashFlowPricer>(vol, discountCurve, useLastFixingDate);
94 return QuantLib::ext::make_shared<QuantExt::BachelierCPICashFlowPricer>(vol, discountCurve, useLastFixingDate);
Abstract template engine builder class.
Abstract template EngineBuilder class that can cache engines and coupon pricers.
virtual QuantLib::ext::shared_ptr< QuantExt::InflationCashFlowPricer > engineImpl(const string &indexName) override
CapFlooredCpiLegCashFlowEngineBuilder()
virtual string keyImpl(const string &indexName) override
CouponPricer Builder for Capped/Floored CPI Inflation Leg.
CapFlooredCpiLegCouponEngineBuilder()
virtual QuantLib::ext::shared_ptr< QuantLib::InflationCouponPricer > engineImpl(const string &indexName) override
virtual string keyImpl(const string &indexName) override
QuantLib::ext::shared_ptr< Market > market_
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)
bool parseBool(const string &s)
Convert text to bool.
bool isCPIVolSurfaceLogNormal(const boost::shared_ptr< QuantLib::CPIVolatilitySurface > &surface)
Serializable Credit Default Swap.