24#ifndef quantext_bma_index_wrapper_hpp
25#define quantext_bma_index_wrapper_hpp
27#include <ql/indexes/bmaindex.hpp>
28#include <ql/indexes/iborindex.hpp>
49 : IborIndex(
bma->
name(),
bma->tenor(),
bma->fixingDays(),
bma->currency(),
bma->fixingCalendar(),
53 BMAIndexWrapper(
const QuantLib::ext::shared_ptr<QuantLib::BMAIndex>&
bma,
const Handle<YieldTermStructure>& h)
54 : IborIndex(
bma->
name(),
bma->tenor(),
bma->fixingDays(),
bma->currency(),
bma->fixingCalendar(),
55 ModifiedFollowing, false,
bma->dayCounter(), h),
56 bma_(new BMAIndex(h)) {}
59 std::string
name()
const override {
return bma_->name(); }
62 return fixingCalendar().isBusinessDay(date);
66 Date d =
bma_->maturityDate(valueDate);
69 return std::max<Date>(d, valueDate + 1);
71 Schedule
fixingSchedule(
const Date& start,
const Date& end) {
return bma_->fixingSchedule(start, end); }
73 QL_REQUIRE(!termStructure_.empty(),
"null term structure set to this instance of " <<
name());
74 Date start = fixingCalendar().advance(fixingDate, 1, Days);
76 return termStructure_->forwardRate(start, end, dayCounter_, Simple);
80 Date tmp = fixingDate;
81 while (!
bma_->isValidFixingDate(tmp) && tmp > Date::minDate())
90 QuantLib::ext::shared_ptr<IborIndex>
clone(
const Handle<YieldTermStructure>& h)
const override {
95 QuantLib::ext::shared_ptr<QuantLib::BMAIndex>
bma()
const {
return bma_; }
97 operator QuantLib::BMAIndex &() {
return *
bma_; }
98 operator QuantLib::BMAIndex *() {
return &*
bma_; }
101 QuantLib::ext::shared_ptr<QuantLib::BMAIndex>
bma_;
BMAIndexWrapper(const QuantLib::ext::shared_ptr< QuantLib::BMAIndex > &bma)
Rate pastFixing(const Date &fixingDate) const override
Handle< YieldTermStructure > forwardingTermStructure() const
bool isValidFixingDate(const Date &date) const override
Date maturityDate(const Date &valueDate) const override
QuantLib::ext::shared_ptr< QuantLib::BMAIndex > bma() const
std::string name() const override
BMAIndexWrapper(const QuantLib::ext::shared_ptr< QuantLib::BMAIndex > &bma, const Handle< YieldTermStructure > &h)
QuantLib::ext::shared_ptr< IborIndex > clone(const Handle< YieldTermStructure > &h) const override
Date adjustedFixingDate(const Date &fixingDate) const
Rate forecastFixing(const Date &fixingDate) const override
QuantLib::ext::shared_ptr< QuantLib::BMAIndex > bma_
Schedule fixingSchedule(const Date &start, const Date &end)