39 bool subtractInflationNominal,
46 ext::shared_ptr<IborIndex> floatIndex,
53 const Period& observationLag,
54 ext::shared_ptr<ZeroInflationIndex> fixedIndex,
56 Real inflationNominal)
57 :
Swap(2), type_(type), nominal_(nominal), subtractInflationNominal_(subtractInflationNominal),
58 spread_(spread), floatDayCount_(
std::move(floatDayCount)),
59 floatSchedule_(
std::move(floatSchedule)), floatPaymentRoll_(floatPaymentRoll),
60 fixingDays_(fixingDays), floatIndex_(
std::move(floatIndex)), fixedRate_(fixedRate),
61 baseCPI_(baseCPI), fixedDayCount_(
std::move(fixedDayCount)),
62 fixedSchedule_(
std::move(fixedSchedule)), fixedPaymentRoll_(fixedPaymentRoll),
63 fixedIndex_(
std::move(fixedIndex)), observationLag_(observationLag),
64 observationInterpolation_(observationInterpolation) {
92 payNotional = floatingLeg.back()->date();
96 ext::shared_ptr<CashFlow> nf(
new SimpleCashFlow(floatAmount, payNotional));
97 floatingLeg.push_back(nf);
111 Leg::const_iterator i;
116 for (i = floatingLeg.begin(); i < floatingLeg.end(); ++i) {
121 legs_[1] = floatingLeg;
178 static const Spread basisPoint = 1.0e-4;
Cash-flow analysis functions.
Cash flow vector builders.
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 & withPaymentDayCounter(const DayCounter &)
CPILeg & withObservationInterpolation(CPI::InterpolationType)
Arguments for swap calculation
void validate() const override
Results from swap calculation
ext::shared_ptr< IborIndex > floatIndex_
BusinessDayConvention fixedPaymentRoll_
virtual Rate fairRate() const
BusinessDayConvention floatPaymentRoll_
ext::shared_ptr< ZeroInflationIndex > fixedIndex_
DayCounter fixedDayCount_
CPISwap(Type type, Real nominal, bool subtractInflationNominal, Spread spread, DayCounter floatDayCount, Schedule floatSchedule, const BusinessDayConvention &floatRoll, Natural fixingDays, ext::shared_ptr< IborIndex > floatIndex, Rate fixedRate, Real baseCPI, DayCounter fixedDayCount, Schedule fixedSchedule, const BusinessDayConvention &fixedRoll, const Period &observationLag, ext::shared_ptr< ZeroInflationIndex > fixedIndex, CPI::InterpolationType observationInterpolation=CPI::AsIndex, Real inflationNominal=Null< Real >())
DayCounter floatDayCount_
virtual Spread fairSpread() const
virtual Real floatLegNPV() const
virtual Real inflationNominal() const
virtual const Leg & cpiLeg() const
void setupArguments(PricingEngine::arguments *args) const override
for simple case sufficient to copy base class
CPI::InterpolationType observationInterpolation_
void setupExpired() const override
void fetchResults(const PricingEngine::results *) const override
virtual bool subtractInflationNominal() const
bool subtractInflationNominal_
virtual Real fixedLegNPV() const
Date adjust(const Date &, BusinessDayConvention convention=Following) const
helper class building a sequence of capped/floored ibor-rate coupons
IborLeg & withSpreads(Spread spread)
IborLeg & withPaymentAdjustment(BusinessDayConvention)
IborLeg & withPaymentDayCounter(const DayCounter &)
IborLeg & withNotionals(Real notional)
IborLeg & withFixingDays(Natural fixingDays)
void calculate() const override
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
const Calendar & calendar() const
void validate() const override
void setupArguments(PricingEngine::arguments *) const override
std::vector< Real > legNPV_
std::vector< Real > legBPS_
void setupExpired() const override
void fetchResults(const PricingEngine::results *) const override
std::vector< Real > payer_
Coupon paying a zero-inflation index.
zero-inflation-indexed-ratio-with-base swap
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Coupon paying a fixed annual rate.
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Real Spread
spreads on interest rates
Coupon paying a Libor-type index.
base classes for inflation indexes
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
ext::shared_ptr< YieldTermStructure > r
InterpolationType
when you observe an index, how do you interpolate between fixings?
Interest-rate term structure.