35#include <ql/cashflows/capflooredinflationcoupon.hpp>
36#include <ql/cashflows/cashflowvectors.hpp>
37#include <ql/cashflows/inflationcoupon.hpp>
38#include <ql/cashflows/inflationcouponpricer.hpp>
45 const Period& observationLag) {
48 denumatorDate - observationLag_, -
static_cast<Integer
>(fixingDays_), Days, ModifiedPreceding);
51 numeratorDate - observationLag_, -
static_cast<Integer
>(fixingDays_), Days, ModifiedPreceding);
55 const Date& paymentDate, Real nominal,
const Date& startDate,
const Date& endDate, Natural fixingDays,
56 const ext::shared_ptr<ZeroInflationIndex>& index,
const Period& observationLag,
const DayCounter& dayCounter,
57 Real gearing, Spread spread,
const Date& refPeriodStart,
const Date& refPeriodEnd,
bool addInflationNotional, QuantLib::CPI::InterpolationType interpolation)
58 :
QuantLib::
InflationCoupon(paymentDate, nominal, startDate, endDate, fixingDays, index, observationLag, dayCounter,
59 refPeriodStart, refPeriodEnd),
60 gearing_(gearing),
spread_(spread), addInflationNotional_(addInflationNotional),
61 interpolationType_(interpolation) {
66 Visitor<NonStandardYoYInflationCoupon>* v1 =
dynamic_cast<Visitor<NonStandardYoYInflationCoupon>*
>(&v);
70 InflationCoupon::accept(v);
74 return static_cast<bool>(ext::dynamic_pointer_cast<NonStandardYoYInflationCouponPricer>(pricer));
81 auto zii = QuantLib::ext::dynamic_pointer_cast<QuantLib::ZeroInflationIndex>(index_);
84 return I_t / I_s - 1.0;
92 Rate r = InflationCoupon::rate();
102 return ext::dynamic_pointer_cast<ZeroInflationIndex>(index_);
bool addInflationNotional_
virtual Date fixingDateNumerator() const
bool checkPricerImpl(const ext::shared_ptr< InflationCouponPricer > &) const override
virtual Rate indexFixing() const override
QuantLib::CPI::InterpolationType interpolationType_
virtual ext::shared_ptr< ZeroInflationIndex > cpiIndex() const
void setFixingDates(const Date &denumatorDate, const Date &numeratorDate, const Period &observationLag)
virtual Date fixingDateDenumerator() const
virtual Rate rate() const override
Date fixingDateNumerator_
virtual void accept(AcyclicVisitor &) override
Real gearing() const
index gearing, i.e. multiplicative coefficient for the index
Rate adjustedFixing() const
NonStandardYoYInflationCoupon(const Date &paymentDate, Real nominal, const Date &startDate, const Date &endDate, Natural fixingDays, const ext::shared_ptr< ZeroInflationIndex > &index, const Period &observationLag, const DayCounter &dayCounter, Real gearing=1.0, Spread spread=0.0, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date(), bool addInflationNotional=false, QuantLib::CPI::InterpolationType interpolation=QuantLib::CPI::InterpolationType::Flat)
Date fixingDateDenumerator_
bool addInflationNotional() const
Spread spread() const
spread paid over the fixing of the underlying index
virtual Date fixingDate() const override
pricer for the generalized (nonstandard) yoy coupon the payoff of the coupon is: N * (alpha * I_t/I_s...
capped floored coupon which generalize the yoy inflation coupon it pays: N * (alpha * I_t/I_s + beta)...