21#include <ql/instruments/bonds/floatingratebond.hpp>
22#include <ql/cashflows/iborcoupon.hpp>
23#include <ql/cashflows/simplecashflow.hpp>
24#include <ql/time/schedule.hpp>
25#include <ql/indexes/swapindex.hpp>
26#include <ql/indexes/iborindex.hpp>
34 const ext::shared_ptr<IborIndex>& iborIndex,
38 const std::vector<Real>& gearings,
39 const std::vector<Spread>& spreads,
40 const std::vector<Rate>& caps,
41 const std::vector<Rate>& floors,
44 const Date& issueDate,
45 const Period& exCouponPeriod,
48 bool exCouponEndOfMonth)
49 :
Bond(settlementDays, schedule.calendar(), issueDate) {
63 .
withExCouponPeriod(exCouponPeriod, exCouponCalendar, exCouponConvention, exCouponEndOfMonth);
67 QL_ENSURE(!
cashflows().empty(),
"bond with no cashflows!");
68 QL_ENSURE(
redemptions_.size() == 1,
"multiple redemptions created");
void addRedemptionsToCashflows(const std::vector< Real > &redemptions=std::vector< Real >())
const Leg & cashflows() const
const ext::shared_ptr< CashFlow > & redemption() const
FloatingRateBond(Natural settlementDays, Real faceAmount, const Schedule &schedule, const ext::shared_ptr< IborIndex > &iborIndex, const DayCounter &accrualDayCounter, BusinessDayConvention paymentConvention=Following, Natural fixingDays=Null< Natural >(), const std::vector< Real > &gearings={ 1.0 }, const std::vector< Spread > &spreads={ 0.0 }, const std::vector< Rate > &caps={}, const std::vector< Rate > &floors={}, bool inArrears=false, Real redemption=100.0, const Date &issueDate=Date(), const Period &exCouponPeriod=Period(), const Calendar &exCouponCalendar=Calendar(), BusinessDayConvention exCouponConvention=Unadjusted, bool exCouponEndOfMonth=false)
helper class building a sequence of capped/floored ibor-rate coupons
IborLeg & withSpreads(Spread spread)
IborLeg & withPaymentAdjustment(BusinessDayConvention)
IborLeg & withPaymentDayCounter(const DayCounter &)
IborLeg & inArrears(bool flag=true)
IborLeg & withFloors(Rate floor)
IborLeg & withNotionals(Real notional)
IborLeg & withGearings(Real gearing)
IborLeg & withExCouponPeriod(const Period &, const Calendar &, BusinessDayConvention, bool endOfMonth=false)
IborLeg & withCaps(Rate cap)
IborLeg & withFixingDays(Natural fixingDays)
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
const Date & endDate() const
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer