31 const QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex,
const Real spread,
32 const Date& switchDate,
const bool useRfrCurve)
34 useRfrCurve ? rfrIndex
35 :
QuantLib::ext::dynamic_pointer_cast<OvernightIndex>(
36 rfrIndex->clone(originalIndex->forwardingTermStructure())),
39 originalIndex, rfrIndex, spread, switchDate))
40 : originalIndex->forwardingTermStructure()) {}
43 const QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex,
const Real spread,
44 const Date& switchDate,
const Handle<YieldTermStructure>& forwardingCurve)
45 : IborIndex(originalIndex->familyName(), originalIndex->tenor(), originalIndex->fixingDays(),
46 originalIndex->currency(), originalIndex->fixingCalendar(), originalIndex->businessDayConvention(),
47 originalIndex->endOfMonth(), originalIndex->dayCounter(), forwardingCurve),
48 originalIndex_(originalIndex), rfrIndex_(rfrIndex),
spread_(spread), switchDate_(switchDate) {
51 registerWith(forwardingCurve);
56 IborIndex::addFixing(fixingDate,
fixing, forceOverwrite);
58 QL_FAIL(
"Can not add fixing value "
59 <<
fixing <<
" for fixing date " << fixingDate <<
" to fall back ibor index '" << name()
60 <<
"' fixing history, since fixing date is after switch date (" <<
switchDate_ <<
")");
65 const bool telescopicValueDates)
const {
66 QL_REQUIRE(iborFixingDate >=
switchDate_,
"FallbackIborIndex: onCoupon for ibor fixing date "
67 << iborFixingDate <<
" requested, which is before switch date "
71 return QuantLib::ext::make_shared<OvernightIndexedCoupon>(maturityDate, 1.0, valueDate, maturityDate,
rfrIndex_, 1.0, 0.0,
72 Date(), Date(), DayCounter(), telescopicValueDates,
false,
73 2 * Days, 0, Null<Size>());
77 Date today = Settings::instance().evaluationDate();
81 if (fixingDate > today) {
82 return IborIndex::forecastFixing(fixingDate);
84 if (QuantLib::ext::dynamic_pointer_cast<OvernightIndex>(
originalIndex_))
92 Date today = Settings::instance().evaluationDate();
104 Date today = Settings::instance().evaluationDate();
105 Handle<YieldTermStructure> curve =
107 QL_REQUIRE(!curve.empty(),
"FallbackIborIndex: null term structure set for " << name() <<
", today=" << today
109 DiscountFactor disc1 = curve->discount(valueDate);
110 DiscountFactor disc2 = curve->discount(endDate);
111 return (disc1 / disc2 - 1.0) / t;
Rate forecastFixing(const Date &valueDate, const Date &endDate, Time t) const override
QuantLib::ext::shared_ptr< IborIndex > originalIndex_
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex_
Rate pastFixing(const Date &fixingDate) const override
QuantLib::ext::shared_ptr< IborIndex > clone(const Handle< YieldTermStructure > &forwarding) const override
void addFixing(const Date &fixingDate, Real fixing, bool forceOverwrite=false) override
FallbackIborIndex(const QuantLib::ext::shared_ptr< IborIndex > originalIndex, const QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex, const Real spread, const Date &switchDate, const bool useRfrCurve)
QuantLib::ext::shared_ptr< OvernightIndexedCoupon > onCoupon(const Date &iborFixingDate, const bool telescopicValueDates=false) const
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex() const
const Date & switchDate() const
QuantLib::ext::shared_ptr< IborIndex > originalIndex() const
Real fixing(const Date &fixingDate, bool forecastTodaysFixing=false) const override
wrapper class for ibor index managing the fallback rules
projection curve for ibor fallback indices