24#include <boost/make_shared.hpp>
31 Handle<YieldTermStructure> discount =
33 Handle<QuantExt::YoYOptionletVolatilitySurface> ovs =
36 return QuantLib::ext::make_shared<QuantExt::YoYInflationBlackCapFloorEngine>(
37 *yoyTs, Handle<QuantLib::YoYOptionletVolatilitySurface>(), discount);
38 switch (ovs->volatilityType()) {
39 case ShiftedLognormal:
40 if (ovs->displacement() == 0.0) {
41 LOG(
"Build YoYInflationBlackCapFloorEngine for inflation index " << indexName);
42 return QuantLib::ext::make_shared<QuantExt::YoYInflationBlackCapFloorEngine>(
43 *yoyTs, Handle<QuantLib::YoYOptionletVolatilitySurface>(ovs), discount);
46 LOG(
"Build YoYInflationUnitDisplacedBlackCapFloorEngine for inflation index " << indexName);
47 return QuantLib::ext::make_shared<QuantExt::YoYInflationUnitDisplacedBlackCapFloorEngine>(
48 *yoyTs, Handle<QuantLib::YoYOptionletVolatilitySurface>(ovs), discount);
52 LOG(
"Build YoYInflationBachelierCapFloorEngine for inflation index " << indexName);
53 return QuantLib::ext::make_shared<QuantExt::YoYInflationBachelierCapFloorEngine>(
54 *yoyTs, Handle<QuantLib::YoYOptionletVolatilitySurface>(ovs), discount);
57 QL_FAIL(
"Caplet volatility type, " << ovs->volatilityType() <<
", not covered in EngineFactory");
QuantLib::ext::shared_ptr< Market > market_
const string & configuration(const MarketContext &key)
Return a configuration (or the default one if key not found)
virtual QuantLib::ext::shared_ptr< PricingEngine > engineImpl(const string &indexName) override
Classes and functions for log message handling.
#define LOG(text)
Logging Macro (Level = Notice)
Serializable Credit Default Swap.
Engine builder for year-on-year inflation caps/floors.