29 Date previousWednesday(
const Date& date) {
32 return date - (w - 4) *
Days;
34 return date + (4 - w - 7) *
Days;
37 Date nextWednesday(
const Date& date) {
38 return previousWednesday(date+7);
50 termStructure_(
std::move(h)) {
59 for (
Date d = previousWednesday(date);
d<date; ++
d) {
80 .
to(nextWednesday(end))
89 "null term structure set to this instance of " <<
name());
Bond Market Association index.
Handle< YieldTermStructure > forwardingTermStructure() const
Date maturityDate(const Date &valueDate) const override
BMAIndex(Handle< YieldTermStructure > h={})
bool isValidFixingDate(const Date &fixingDate) const override
Handle< YieldTermStructure > termStructure_
Rate forecastFixing(const Date &fixingDate) const override
It can be overridden to implement particular conventions.
Schedule fixingSchedule(const Date &start, const Date &end)
bool isBusinessDay(const Date &d) const
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Shared handle to an observable.
base class for interest rate indexes
Calendar fixingCalendar() const override
returns the calendar defining valid fixing dates
std::string name() const override
Returns the name of the index.
virtual Date valueDate(const Date &fixingDate) const
Date fixingDate(const Date &valueDate) const
MakeSchedule & withConvention(BusinessDayConvention)
MakeSchedule & to(const Date &terminationDate)
MakeSchedule & from(const Date &effectiveDate)
MakeSchedule & withFrequency(Frequency)
MakeSchedule & forwards()
MakeSchedule & withCalendar(const Calendar &)
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified