31 const Date& startDate,
34 const ext::shared_ptr<SwapIndex>& swapIndex,
37 const Date& refPeriodStart,
38 const Date& refPeriodEnd,
41 const Date& exCouponDate)
43 fixingDays, swapIndex, gearing, spread,
44 refPeriodStart, refPeriodEnd,
45 dayCounter, isInArrears, exCouponDate),
46 swapIndex_(swapIndex) {}
58 : schedule_(
std::move(schedule)), swapIndex_(
std::move(swapIndex)) {
93 gearings_ = std::vector<Real>(1, gearing);
103 spreads_ = std::vector<Spread>(1, spread);
113 caps_ = std::vector<Rate>(1, cap);
123 floors_ = std::vector<Rate>(1, floor);
154 CmsLeg::operator
Leg()
const {
155 return FloatingLeg<SwapIndex, CmsCoupon, CappedFlooredCmsCoupon>(
156 schedule_, notionals_, swapIndex_, paymentDayCounter_,
157 paymentAdjustment_, fixingDays_, gearings_, spreads_,
158 caps_, floors_, inArrears_, zeroPayments_,
160 exCouponPeriod_, exCouponCalendar_,
161 exCouponAdjustment_, exCouponEndOfMonth_);
Floating rate coupon with additional cap/floor.
Cash flow vector builders.
degenerate base class for the Acyclic Visitor pattern
void accept(AcyclicVisitor &) override
CmsCoupon(const Date &paymentDate, Real nominal, const Date &startDate, const Date &endDate, Natural fixingDays, const ext::shared_ptr< SwapIndex > &index, Real gearing=1.0, Spread spread=0.0, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date(), const DayCounter &dayCounter=DayCounter(), bool isInArrears=false, const Date &exCouponDate=Date())
helper class building a sequence of capped/floored cms-rate coupons
BusinessDayConvention paymentAdjustment_
std::vector< Rate > caps_
BusinessDayConvention exCouponAdjustment_
CmsLeg & withFloors(Rate floor)
CmsLeg & withCaps(Rate cap)
CmsLeg & withGearings(Real gearing)
ext::shared_ptr< SwapIndex > swapIndex_
std::vector< Real > notionals_
std::vector< Spread > spreads_
CmsLeg & withSpreads(Spread spread)
CmsLeg & withExCouponPeriod(const Period &, const Calendar &, BusinessDayConvention, bool endOfMonth)
CmsLeg & withPaymentDayCounter(const DayCounter &)
CmsLeg & inArrears(bool flag=true)
CmsLeg & withZeroPayments(bool flag=true)
std::vector< Natural > fixingDays_
CmsLeg & withNotionals(Real notional)
Calendar exCouponCalendar_
std::vector< Rate > floors_
CmsLeg(Schedule schedule, ext::shared_ptr< SwapIndex > swapIndex)
CmsLeg & withPaymentAdjustment(BusinessDayConvention)
CmsLeg & withFixingDays(Natural fixingDays)
std::vector< Real > gearings_
DayCounter paymentDayCounter_
base floating-rate coupon class
void accept(AcyclicVisitor &) override
Visitor for a specific class
virtual void visit(T &)=0
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Real Spread
spreads on interest rates
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
ext::shared_ptr< BlackVolTermStructure > v