40 ext::shared_ptr<YoYInflationIndex> yoyIndex,
41 const Period& observationLag,
46 :
Swap(2), type_(type), nominal_(nominal), fixedSchedule_(
std::move(fixedSchedule)),
47 fixedRate_(fixedRate), fixedDayCount_(
std::move(fixedDayCount)),
48 yoySchedule_(
std::move(yoySchedule)), yoyIndex_(
std::move(yoyIndex)),
49 observationLag_(observationLag), spread_(spread), yoyDayCount_(
std::move(yoyDayCount)),
50 paymentCalendar_(
std::move(paymentCalendar)), paymentConvention_(paymentConvention) {
63 Leg::const_iterator i;
94 std::vector<Date>(fixedCoupons.size());
97 for (
Size i=0; i<fixedCoupons.size(); ++i) {
98 ext::shared_ptr<FixedRateCoupon> coupon =
99 ext::dynamic_pointer_cast<FixedRateCoupon>(fixedCoupons[i]);
110 std::vector<Date>(yoyCoupons.size());
112 std::vector<Time>(yoyCoupons.size());
114 std::vector<Spread>(yoyCoupons.size());
116 for (
Size i=0; i<yoyCoupons.size(); ++i) {
117 ext::shared_ptr<YoYInflationCoupon> coupon =
118 ext::dynamic_pointer_cast<YoYInflationCoupon>(yoyCoupons[i]);
168 static const Spread basisPoint = 1.0e-4;
202 "number of fixed start dates different from "
203 "number of fixed payment dates");
205 "number of fixed payment dates different from "
206 "number of fixed coupon amounts");
208 "number of yoy start dates different from "
209 "number of yoy payment dates");
211 "number of yoy fixing dates different from "
212 "number of yoy payment dates");
214 "number of yoy accrual Times different from "
215 "number of yoy payment dates");
217 "number of yoy spreads different from "
218 "number of yoy payment dates");
220 "number of yoy payment dates different from "
221 "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
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
YearOnYearInflationSwap(Type type, Real nominal, Schedule fixedSchedule, Rate fixedRate, DayCounter fixedDayCount, Schedule yoySchedule, ext::shared_ptr< YoYInflationIndex > yoyIndex, const Period &observationLag, Spread spread, DayCounter yoyDayCount, Calendar paymentCalendar, BusinessDayConvention paymentConvention=ModifiedFollowing)
void fetchResults(const PricingEngine::results *) const override
ext::shared_ptr< YoYInflationIndex > yoyIndex_
virtual Real fixedLegNPV() const
yoyInflationLeg & withSpreads(Spread spread)
yoyInflationLeg & withPaymentAdjustment(BusinessDayConvention)
yoyInflationLeg & withNotionals(Real notional)
yoyInflationLeg & withPaymentDayCounter(const DayCounter &)
#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
Year-on-year inflation-indexed swap.
Interest-rate term structure.
Coupon paying a yoy inflation index.