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 : OvernightIndex(originalIndex->familyName(), originalIndex->fixingDays(),
46 originalIndex->currency(), originalIndex->fixingCalendar(),
47 originalIndex->dayCounter(), forwardingCurve),
48 originalIndex_(originalIndex), rfrIndex_(rfrIndex),
spread_(spread), switchDate_(switchDate),
52 registerWith(forwardingCurve);
57 IborIndex::addFixing(fixingDate,
fixing, forceOverwrite);
59 QL_FAIL(
"Can not add fixing value "
60 <<
fixing <<
" for fixing date " << fixingDate <<
" to fall back ibor index '" << name()
61 <<
"' fixing history, since fixing date is after switch date (" <<
switchDate_ <<
")");
66 Date today = Settings::instance().evaluationDate();
70 if (fixingDate > today) {
71 return IborIndex::forecastFixing(fixingDate);
78 Date today = Settings::instance().evaluationDate();
90 Date today = Settings::instance().evaluationDate();
91 Handle<YieldTermStructure> curve =
93 QL_REQUIRE(!curve.empty(),
"FallbackOvernightIndex: null term structure set for " << name() <<
", today=" << today
95 DiscountFactor disc1 = curve->discount(valueDate);
96 DiscountFactor disc2 = curve->discount(endDate);
97 return (disc1 / disc2 - 1.0) / t;
FallbackOvernightIndex(const QuantLib::ext::shared_ptr< OvernightIndex > originalIndex, const QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex, const Real spread, const Date &switchDate, const bool useRfrCurve)
Rate forecastFixing(const Date &valueDate, const Date &endDate, Time t) const override
QuantLib::ext::shared_ptr< OvernightIndex > originalIndex() const
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
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex() const
QuantLib::ext::shared_ptr< OvernightIndex > originalIndex_
const Date & switchDate() const
Real fixing(const Date &fixingDate, bool forecastTodaysFixing=false) const override
wrapper class for overnight index managing the fallback rules