22#include <ql/cashflows/cashflows.hpp>
23#include <ql/cashflows/cashflowvectors.hpp>
24#include <ql/cashflows/couponpricer.hpp>
25#include <ql/cashflows/fixedratecoupon.hpp>
26#include <ql/cashflows/iborcoupon.hpp>
27#include <ql/cashflows/simplecashflow.hpp>
28#include <ql/indexes/inflationindex.hpp>
29#include <ql/instruments/cpicapfloor.hpp>
30#include <ql/termstructures/yieldtermstructure.hpp>
31#include <ql/time/schedule.hpp>
39 const Date& startDate,
47 const ext::shared_ptr<ZeroInflationIndex>& index,
48 const Period& observationLag,
50 : type_(type), nominal_(nominal), startDate_(startDate), baseCPI_(baseCPI), maturity_(maturity),
51 fixCalendar_(
std::move(fixCalendar)), fixConvention_(fixConvention),
52 payCalendar_(
std::move(payCalendar)), payConvention_(payConvention), strike_(strike),
53 index_(index), observationLag_(observationLag),
54 observationInterpolation_(observationInterpolation) {
55 QL_REQUIRE(
index_,
"no inflation index passed");
61 "CPIcapfloor's observationLag must be at least availabilityLag of inflation index: "
62 <<
"when the observation is effectively flat"
66 "CPIcapfloor's observationLag must be greater than availabilityLag of inflation index: "
67 <<
"when the observation is effectively linear"
98 QL_REQUIRE(
arguments !=
nullptr,
"wrong argument type, not CPICapFloor::arguments*");
BusinessDayConvention payConvention
CPI::InterpolationType observationInterpolation
ext::shared_ptr< ZeroInflationIndex > index
BusinessDayConvention fixConvention
void validate() const override
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
returns whether the instrument might have value greater than zero.
ext::shared_ptr< ZeroInflationIndex > index_
CPICapFloor(Option::Type type, Real nominal, const Date &startDate, Real baseCPI, const Date &maturity, Calendar fixCalendar, BusinessDayConvention fixConvention, Calendar payCalendar, BusinessDayConvention payConvention, Rate strike, const ext::shared_ptr< ZeroInflationIndex > &inflationIndex, const Period &observationLag, CPI::InterpolationType observationInterpolation=CPI::AsIndex)
CPI::InterpolationType observationInterpolation_
BusinessDayConvention payConvention_
BusinessDayConvention fixConvention_
Date adjust(const Date &, BusinessDayConvention convention=Following) const
static Settings & instance()
access to the unique instance
BusinessDayConvention
Business Day conventions.
bool isInterpolated(const ext::shared_ptr< ZeroInflationIndex > &index, const QuantLib::CPI::InterpolationType &type=QuantLib::CPI::AsIndex)
InterpolationType
when you observe an index, how do you interpolate between fixings?