#include <qle/indexes/fallbackiborindex.hpp>
|
| FallbackIborIndex (const QuantLib::ext::shared_ptr< IborIndex > originalIndex, const QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex, const Real spread, const Date &switchDate, const bool useRfrCurve) |
|
| FallbackIborIndex (const QuantLib::ext::shared_ptr< IborIndex > originalIndex, const QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex, const Real spread, const Date &switchDate, const Handle< YieldTermStructure > &forwardingCurve) |
|
void | addFixing (const Date &fixingDate, Real fixing, bool forceOverwrite=false) override |
|
Real | fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override |
|
Rate | pastFixing (const Date &fixingDate) const override |
|
QuantLib::ext::shared_ptr< IborIndex > | clone (const Handle< YieldTermStructure > &forwarding) const override |
|
QuantLib::ext::shared_ptr< IborIndex > | originalIndex () const |
|
QuantLib::ext::shared_ptr< OvernightIndex > | rfrIndex () const |
|
Real | spread () const |
|
const Date & | switchDate () const |
|
QuantLib::ext::shared_ptr< OvernightIndexedCoupon > | onCoupon (const Date &iborFixingDate, const bool telescopicValueDates=false) const |
|
|
Rate | forecastFixing (const Date &valueDate, const Date &endDate, Time t) const override |
|
Definition at line 35 of file fallbackiborindex.hpp.
◆ FallbackIborIndex() [1/2]
FallbackIborIndex |
( |
const QuantLib::ext::shared_ptr< IborIndex > |
originalIndex, |
|
|
const QuantLib::ext::shared_ptr< OvernightIndex > |
rfrIndex, |
|
|
const Real |
spread, |
|
|
const Date & |
switchDate, |
|
|
const bool |
useRfrCurve |
|
) |
| |
Definition at line 30 of file fallbackiborindex.cpp.
35 : QuantLib::ext::dynamic_pointer_cast<OvernightIndex>(
38 useRfrCurve ? Handle<YieldTermStructure>(QuantLib::ext::make_shared<IborFallbackCurve>(
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< OvernightIndex > rfrIndex() const
const Date & switchDate() const
QuantLib::ext::shared_ptr< IborIndex > originalIndex() const
◆ FallbackIborIndex() [2/2]
FallbackIborIndex |
( |
const QuantLib::ext::shared_ptr< IborIndex > |
originalIndex, |
|
|
const QuantLib::ext::shared_ptr< OvernightIndex > |
rfrIndex, |
|
|
const Real |
spread, |
|
|
const Date & |
switchDate, |
|
|
const Handle< YieldTermStructure > & |
forwardingCurve |
|
) |
| |
Definition at line 42 of file fallbackiborindex.cpp.
51 registerWith(forwardingCurve);
52}
QuantLib::ext::shared_ptr< IborIndex > originalIndex_
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex_
◆ addFixing()
void addFixing |
( |
const Date & |
fixingDate, |
|
|
Real |
fixing, |
|
|
bool |
forceOverwrite = false |
|
) |
| |
|
override |
Definition at line 54 of file fallbackiborindex.cpp.
54 {
56 IborIndex::addFixing(fixingDate,
fixing, forceOverwrite);
57 } else {
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_ <<
")");
61 }
62}
Real fixing(const Date &fixingDate, bool forecastTodaysFixing=false) const override
◆ fixing()
Real fixing |
( |
const Date & |
fixingDate, |
|
|
bool |
forecastTodaysFixing = false |
|
) |
| const |
|
override |
Definition at line 76 of file fallbackiborindex.cpp.
76 {
77 Date today = Settings::instance().evaluationDate();
80 }
81 if (fixingDate > today) {
82 return IborIndex::forecastFixing(fixingDate);
83 } else {
84 if (QuantLib::ext::dynamic_pointer_cast<OvernightIndex>(
originalIndex_))
86 else
88 }
89}
QuantLib::ext::shared_ptr< OvernightIndexedCoupon > onCoupon(const Date &iborFixingDate, const bool telescopicValueDates=false) const
◆ pastFixing()
Rate pastFixing |
( |
const Date & |
fixingDate | ) |
const |
|
override |
Definition at line 91 of file fallbackiborindex.cpp.
91 {
92 Date today = Settings::instance().evaluationDate();
95 }
97}
◆ clone()
QuantLib::ext::shared_ptr< IborIndex > clone |
( |
const Handle< YieldTermStructure > & |
forwarding | ) |
const |
|
override |
◆ originalIndex()
QuantLib::ext::shared_ptr< IborIndex > originalIndex |
( |
| ) |
const |
◆ rfrIndex()
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex |
( |
| ) |
const |
◆ spread()
◆ switchDate()
const Date & switchDate |
( |
| ) |
const |
◆ onCoupon()
QuantLib::ext::shared_ptr< OvernightIndexedCoupon > onCoupon |
( |
const Date & |
iborFixingDate, |
|
|
const bool |
telescopicValueDates = false |
|
) |
| const |
Definition at line 64 of file fallbackiborindex.cpp.
65 {
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>());
74}
◆ forecastFixing()
Rate forecastFixing |
( |
const Date & |
valueDate, |
|
|
const Date & |
endDate, |
|
|
Time |
t |
|
) |
| const |
|
overrideprivate |
Definition at line 103 of file fallbackiborindex.cpp.
103 {
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;
112}
◆ originalIndex_
QuantLib::ext::shared_ptr<IborIndex> originalIndex_ |
|
private |
◆ rfrIndex_
QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex_ |
|
private |
◆ spread_
◆ switchDate_