20#include <ql/cashflows/cashflows.hpp>
21#include <ql/cashflows/cashflowvectors.hpp>
22#include <ql/cashflows/couponpricer.hpp>
23#include <ql/cashflows/cpicoupon.hpp>
24#include <ql/cashflows/fixedratecoupon.hpp>
25#include <ql/cashflows/iborcoupon.hpp>
26#include <ql/cashflows/simplecashflow.hpp>
27#include <ql/indexes/inflationindex.hpp>
28#include <ql/instruments/bonds/cpibond.hpp>
29#include <ql/termstructures/yieldtermstructure.hpp>
30#include <ql/time/schedule.hpp>
40 const Period& observationLag,
41 ext::shared_ptr<ZeroInflationIndex> cpiIndex,
44 const std::vector<Rate>& fixedRate,
47 const Date& issueDate,
49 const Period& exCouponPeriod,
52 bool exCouponEndOfMonth)
53 :
Bond(settlementDays,
54 paymentCalendar ==
Calendar() ? schedule.calendar() : paymentCalendar,
56 frequency_(schedule.tenor().frequency()), dayCounter_(accrualDayCounter),
57 growthOnly_(growthOnly), baseCPI_(baseCPI), observationLag_(observationLag),
58 cpiIndex_(
std::move(cpiIndex)), observationInterpolation_(observationInterpolation) {
83 Leg::const_iterator i;
void calculateNotionalsFromCashflows()
ext::shared_ptr< ZeroInflationIndex > cpiIndex_
CPI::InterpolationType observationInterpolation_
CPIBond(Natural settlementDays, Real faceAmount, bool growthOnly, Real baseCPI, const Period &observationLag, ext::shared_ptr< ZeroInflationIndex > cpiIndex, CPI::InterpolationType observationInterpolation, const Schedule &schedule, const std::vector< Rate > &coupons, const DayCounter &accrualDayCounter, BusinessDayConvention paymentConvention=ModifiedFollowing, const Date &issueDate=Date(), const Calendar &paymentCalendar=Calendar(), const Period &exCouponPeriod=Period(), const Calendar &exCouponCalendar=Calendar(), BusinessDayConvention exCouponConvention=Unadjusted, bool exCouponEndOfMonth=false)
Helper class building a sequence of capped/floored CPI coupons.
CPILeg & withNotionals(Real notional)
CPILeg & withPaymentAdjustment(BusinessDayConvention)
CPILeg & withSubtractInflationNominal(bool)
CPILeg & withFixedRates(Real fixedRate)
CPILeg & withExCouponPeriod(const Period &, const Calendar &, BusinessDayConvention, bool endOfMonth=false)
CPILeg & withPaymentDayCounter(const DayCounter &)
CPILeg & withPaymentCalendar(const Calendar &)
CPILeg & withObservationInterpolation(CPI::InterpolationType)
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
const Date & endDate() const
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
InterpolationType
when you observe an index, how do you interpolate between fixings?