19#include <ql/cashflows/inflationcoupon.hpp>
20#include <ql/cashflows/inflationcouponpricer.hpp>
27 const ext::shared_ptr<CappedFlooredYoYInflationCoupon>& underlying)
28 :
YoYInflationCoupon(underlying->date(), underlying->nominal(), underlying->accrualStartDate(),
29 underlying->accrualEndDate(), underlying->fixingDays(), underlying->yoyIndex(),
30 underlying->observationLag(), underlying->dayCounter(), underlying->gearing(),
31 underlying->spread(), underlying->referencePeriodStart(), underlying->referencePeriodEnd()),
32 underlying_(underlying) {
38 QL_REQUIRE(
underlying_->pricer() != NULL,
"pricer not set");
40 Rate floorletRate = 0.0;
43 Rate capletRate = 0.0;
51 : floorletRate + capletRate;
66 Visitor<StrippedCappedFlooredYoYInflationCoupon>* v1 =
67 dynamic_cast<Visitor<StrippedCappedFlooredYoYInflationCoupon>*
>(&v);
81 YoYInflationCoupon::setPricer(pricer);
86 : underlyingLeg_(underlyingLeg) {}
88StrippedCappedFlooredYoYInflationCouponLeg::operator Leg()
const {
90 resultLeg.reserve(underlyingLeg_.size());
91 ext::shared_ptr<CappedFlooredYoYInflationCoupon> c;
92 for (Leg::const_iterator i = underlyingLeg_.begin(); i != underlyingLeg_.end(); ++i) {
93 if ((c = ext::dynamic_pointer_cast<CappedFlooredYoYInflationCoupon>(*i)) != NULL) {
94 resultLeg.push_back(ext::make_shared<StrippedCappedFlooredYoYInflationCoupon>(c));
96 resultLeg.push_back(*i);
void update() override
Observer interface.
Rate rate() const override
Coupon interface.
virtual void accept(AcyclicVisitor &) override
Visitability.
Rate effectiveCap() const
effective cap
Rate effectiveFloor() const
effective floor
void setPricer(const ext::shared_ptr< YoYInflationCouponPricer > &pricer)
StrippedCappedFlooredYoYInflationCoupon(const ext::shared_ptr< CappedFlooredYoYInflationCoupon > &underlying)
ext::shared_ptr< CappedFlooredYoYInflationCoupon > underlying_
const ext::shared_ptr< CappedFlooredYoYInflationCoupon > underlying()
StrippedCappedFlooredYoYInflationCouponLeg(const Leg &underlyingLeg)
virtual void accept(AcyclicVisitor &) override
strips the embedded option from cap floored yoy inflation coupons