25#ifndef quantext_sub_periods_coupon_hpp
26#define quantext_sub_periods_coupon_hpp
28#include <ql/cashflows/floatingratecoupon.hpp>
29#include <ql/time/schedule.hpp>
34class SubPeriodsCouponPricer1;
49 SubPeriodsCoupon1(
const Date& paymentDate, Real nominal,
const Date& startDate,
const Date& endDate,
50 const QuantLib::ext::shared_ptr<InterestRateIndex>& index,
Type type, BusinessDayConvention convention,
51 Spread
spread = 0.0,
const DayCounter& dayCounter = DayCounter(),
bool includeSpread =
false,
78 void accept(AcyclicVisitor&)
override;
95 SubPeriodsLeg1(
const Schedule& schedule,
const QuantLib::ext::shared_ptr<InterestRateIndex>& index);
107 operator Leg()
const;
111 QuantLib::ext::shared_ptr<InterestRateIndex>
index_;
bool includeSpread() const
whether to include/exclude spread in compounding/averaging
std::vector< Date > fixingDates_
const std::vector< Date > & valueDates() const
value dates for the sub-periods
std::vector< Time > accrualFractions_
void accept(AcyclicVisitor &) override
std::vector< Rate > fixings_
const std::vector< Time > & accrualFractions() const
accrual periods for the sub-periods
std::vector< Date > valueDates_
const std::vector< Rate > & indexFixings() const
fixings for the sub-periods
const std::vector< Date > & fixingDates() const
fixing dates for the sub-periods
Type type() const
whether sub-period fixings are averaged or compounded
Spread spread() const
Need to be able to change spread to solve for fair spread.
Date fixingDate() const override
the date when the coupon is fully determined
helper class building a sequence of sub-period coupons
BusinessDayConvention paymentAdjustment_
SubPeriodsLeg1 & withPaymentDayCounter(const DayCounter &dayCounter)
Calendar paymentCalendar_
SubPeriodsLeg1 & withGearing(Real gearing)
SubPeriodsLeg1 & withType(SubPeriodsCoupon1::Type type)
QuantLib::ext::shared_ptr< InterestRateIndex > index_
SubPeriodsLeg1 & withSpreads(const std::vector< Spread > &spreads)
std::vector< Real > notionals_
std::vector< Spread > spreads_
SubPeriodsLeg1 & withSpread(Spread spread)
SubPeriodsCoupon1::Type type_
SubPeriodsLeg1 & includeSpread(bool includeSpread)
SubPeriodsLeg1 & withGearings(const std::vector< Real > &gearings)
SubPeriodsLeg1 & withPaymentCalendar(const Calendar &calendar)
SubPeriodsLeg1 & withNotional(Real notional)
SubPeriodsLeg1 & withNotionals(const std::vector< Real > ¬ionals)
SubPeriodsLeg1 & withPaymentAdjustment(BusinessDayConvention convention)
std::vector< Real > gearings_
DayCounter paymentDayCounter_