40 ext::shared_ptr<YoYInflationIndex> yoyIndex,
41 const Period& observationLag,
47 :
Swap(2), type_(type), nominal_(nominal), fixedSchedule_(
std::move(fixedSchedule)),
48 fixedRate_(fixedRate), fixedDayCount_(
std::move(fixedDayCount)),
49 yoySchedule_(
std::move(yoySchedule)), yoyIndex_(
std::move(yoyIndex)),
50 observationLag_(observationLag), spread_(spread), yoyDayCount_(
std::move(yoyDayCount)),
65 Leg::const_iterator i;
86 ext::shared_ptr<YoYInflationIndex> yoyIndex,
87 const Period& observationLag,
93 std::move(yoySchedule),
std::move(yoyIndex), observationLag,
CPI::AsIndex,
94 spread,
std::move(yoyDayCount),
std::move(paymentCalendar), paymentConvention) {}
111 std::vector<Date>(fixedCoupons.size());
114 for (
Size i=0; i<fixedCoupons.size(); ++i) {
115 ext::shared_ptr<FixedRateCoupon> coupon =
116 ext::dynamic_pointer_cast<FixedRateCoupon>(fixedCoupons[i]);
127 std::vector<Date>(yoyCoupons.size());
129 std::vector<Time>(yoyCoupons.size());
131 std::vector<Spread>(yoyCoupons.size());
133 for (
Size i=0; i<yoyCoupons.size(); ++i) {
134 ext::shared_ptr<YoYInflationCoupon> coupon =
135 ext::dynamic_pointer_cast<YoYInflationCoupon>(yoyCoupons[i]);
185 static const Spread basisPoint = 1.0e-4;
219 "number of fixed start dates different from "
220 "number of fixed payment dates");
222 "number of fixed payment dates different from "
223 "number of fixed coupon amounts");
225 "number of yoy start dates different from "
226 "number of yoy payment dates");
228 "number of yoy fixing dates different from "
229 "number of yoy payment dates");
231 "number of yoy accrual Times different from "
232 "number of yoy payment dates");
234 "number of yoy spreads different from "
235 "number of yoy payment dates");
237 "number of yoy payment dates different from "
238 "number of yoy coupon amounts");
Cash-flow analysis functions.
Cash flow vector builders.
helper class building a sequence of fixed rate coupons
FixedRateLeg & withNotionals(Real)
FixedRateLeg & withPaymentAdjustment(BusinessDayConvention)
FixedRateLeg & withCouponRates(Rate, const DayCounter &paymentDayCounter, Compounding comp=Simple, Frequency freq=Annual)
void calculate() const override
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
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_
Arguments for YoY swap calculation
std::vector< Date > yoyPayDates
std::vector< Spread > yoySpreads
std::vector< Date > yoyFixingDates
std::vector< Date > yoyResetDates
std::vector< Date > fixedPayDates
std::vector< Time > yoyAccrualTimes
std::vector< Date > fixedResetDates
void validate() const override
std::vector< Real > yoyCoupons
std::vector< Real > fixedCoupons
Results from YoY swap calculation
Year-on-year inflation-indexed swap.
virtual const Leg & yoyLeg() const
virtual Rate fairRate() const
Calendar paymentCalendar_
DayCounter fixedDayCount_
virtual Spread fairSpread() const
virtual Real yoyLegNPV() const
void setupArguments(PricingEngine::arguments *args) const override
BusinessDayConvention paymentConvention_
virtual const Leg & fixedLeg() const
void setupExpired() const override
void fetchResults(const PricingEngine::results *) const override
ext::shared_ptr< YoYInflationIndex > yoyIndex_
virtual Real fixedLegNPV() const
YearOnYearInflationSwap(Type type, Real nominal, Schedule fixedSchedule, Rate fixedRate, DayCounter fixedDayCount, Schedule yoySchedule, ext::shared_ptr< YoYInflationIndex > yoyIndex, const Period &observationLag, CPI::InterpolationType interpolation, Spread spread, DayCounter yoyDayCount, Calendar paymentCalendar, BusinessDayConvention paymentConvention=ModifiedFollowing)
Helper class building a sequence of capped/floored yoy inflation coupons.
yoyInflationLeg & withSpreads(Spread spread)
yoyInflationLeg & withPaymentAdjustment(BusinessDayConvention)
yoyInflationLeg & withNotionals(Real notional)
yoyInflationLeg & withPaymentDayCounter(const DayCounter &)
Calendar paymentCalendar_
#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.
Real Spread
spreads on interest rates
std::size_t Size
size of a container
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?
Year-on-year inflation-indexed swap.
Interest-rate term structure.
Coupon paying a yoy inflation index.