35 const Date& startDate,
38 const ext::shared_ptr<InterestRateIndex>& index,
41 const Date& refPeriodStart,
42 const Date& refPeriodEnd,
45 const Date& exCouponDate)
46 :
Coupon(paymentDate, nominal, startDate, endDate, refPeriodStart, refPeriodEnd, exCouponDate),
47 index_(index), dayCounter_(
std::move(dayCounter)),
48 fixingDays_(fixingDays ==
Null<
Natural>() ? (index ? index->fixingDays() : 0) : fixingDays),
49 gearing_(gearing), spread_(spread), isInArrears_(isInArrears) {
61 const ext::shared_ptr<FloatingRateCouponPricer>& pricer) {
82 return index_->fixingCalendar().advance(refDate,
98 return amount() * discountingCurve->discount(
date());
coupon accruing over a fixed period
virtual Real nominal() const
Date date() const override
Time accruedPeriod(const Date &) const
accrued period as fraction of year at the given date
bool empty() const
Returns whether or not the day counter is initialized.
virtual Date fixingDate() const
fixing date
void performCalculations() const override
FloatingRateCoupon(const Date &paymentDate, Real nominal, const Date &startDate, const Date &endDate, Natural fixingDays, const ext::shared_ptr< InterestRateIndex > &index, Real gearing=1.0, Spread spread=0.0, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date(), DayCounter dayCounter=DayCounter(), bool isInArrears=false, const Date &exCouponDate=Date())
ext::shared_ptr< InterestRateIndex > index_
virtual void setPricer(const ext::shared_ptr< FloatingRateCouponPricer > &)
Rate rate() const override
accrued rate
Real amount() const override
returns the amount of the cash flow
ext::shared_ptr< FloatingRateCouponPricer > pricer_
Real accruedAmount(const Date &) const override
accrued amount at the given date
virtual Rate indexFixing() const
fixing of the underlying index
ext::shared_ptr< FloatingRateCouponPricer > pricer() const
Real price(const Handle< YieldTermStructure > &discountingCurve) const
Shared handle to an observable.
virtual void calculate() const
template class providing a null value for a given type.
Size unregisterWith(const ext::shared_ptr< Observable > &)
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
static Settings & instance()
access to the unique instance
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Coupon paying a variable index-based rate.
unsigned QL_INTEGER Natural
positive integer
QL_INTEGER Integer
integer number
Real Spread
spreads on interest rates
base class for interest rate indexes
Interest-rate term structure.