#include <qle/indexes/fallbackovernightindex.hpp>
|
| FallbackOvernightIndex (const QuantLib::ext::shared_ptr< OvernightIndex > originalIndex, const QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex, const Real spread, const Date &switchDate, const bool useRfrCurve) |
|
| FallbackOvernightIndex (const QuantLib::ext::shared_ptr< OvernightIndex > 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< OvernightIndex > | originalIndex () const |
|
QuantLib::ext::shared_ptr< OvernightIndex > | rfrIndex () const |
|
Real | spread () const |
|
const Date & | switchDate () const |
|
bool | useRfrCurve () const |
|
|
Rate | forecastFixing (const Date &valueDate, const Date &endDate, Time t) const override |
|
Definition at line 35 of file fallbackovernightindex.hpp.
◆ FallbackOvernightIndex() [1/2]
FallbackOvernightIndex |
( |
const QuantLib::ext::shared_ptr< OvernightIndex > |
originalIndex, |
|
|
const QuantLib::ext::shared_ptr< OvernightIndex > |
rfrIndex, |
|
|
const Real |
spread, |
|
|
const Date & |
switchDate, |
|
|
const bool |
useRfrCurve |
|
) |
| |
Definition at line 30 of file fallbackovernightindex.cpp.
35 : QuantLib::ext::dynamic_pointer_cast<OvernightIndex>(
38 useRfrCurve ? Handle<YieldTermStructure>(QuantLib::ext::make_shared<OvernightFallbackCurve>(
FallbackOvernightIndex(const QuantLib::ext::shared_ptr< OvernightIndex > originalIndex, const QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex, const Real spread, const Date &switchDate, const bool useRfrCurve)
QuantLib::ext::shared_ptr< OvernightIndex > originalIndex() const
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex() const
const Date & switchDate() const
◆ FallbackOvernightIndex() [2/2]
FallbackOvernightIndex |
( |
const QuantLib::ext::shared_ptr< OvernightIndex > |
originalIndex, |
|
|
const QuantLib::ext::shared_ptr< OvernightIndex > |
rfrIndex, |
|
|
const Real |
spread, |
|
|
const Date & |
switchDate, |
|
|
const Handle< YieldTermStructure > & |
forwardingCurve |
|
) |
| |
Definition at line 42 of file fallbackovernightindex.cpp.
52 registerWith(forwardingCurve);
53}
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex_
QuantLib::ext::shared_ptr< OvernightIndex > originalIndex_
◆ addFixing()
void addFixing |
( |
const Date & |
fixingDate, |
|
|
Real |
fixing, |
|
|
bool |
forceOverwrite = false |
|
) |
| |
|
override |
Definition at line 55 of file fallbackovernightindex.cpp.
55 {
57 IborIndex::addFixing(fixingDate,
fixing, forceOverwrite);
58 } else {
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_ <<
")");
62 }
63}
Real fixing(const Date &fixingDate, bool forecastTodaysFixing=false) const override
◆ fixing()
Real fixing |
( |
const Date & |
fixingDate, |
|
|
bool |
forecastTodaysFixing = false |
|
) |
| const |
|
override |
Definition at line 65 of file fallbackovernightindex.cpp.
65 {
66 Date today = Settings::instance().evaluationDate();
69 }
70 if (fixingDate > today) {
71 return IborIndex::forecastFixing(fixingDate);
72 } else {
74 }
75}
◆ pastFixing()
Rate pastFixing |
( |
const Date & |
fixingDate | ) |
const |
|
override |
◆ clone()
QuantLib::ext::shared_ptr< IborIndex > clone |
( |
const Handle< YieldTermStructure > & |
forwarding | ) |
const |
|
override |
◆ originalIndex()
QuantLib::ext::shared_ptr< OvernightIndex > originalIndex |
( |
| ) |
const |
◆ rfrIndex()
QuantLib::ext::shared_ptr< OvernightIndex > rfrIndex |
( |
| ) |
const |
◆ spread()
◆ switchDate()
const Date & switchDate |
( |
| ) |
const |
◆ useRfrCurve()
bool useRfrCurve |
( |
| ) |
const |
◆ forecastFixing()
Rate forecastFixing |
( |
const Date & |
valueDate, |
|
|
const Date & |
endDate, |
|
|
Time |
t |
|
) |
| const |
|
overrideprivate |
Definition at line 89 of file fallbackovernightindex.cpp.
89 {
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;
98}
◆ originalIndex_
QuantLib::ext::shared_ptr<OvernightIndex> originalIndex_ |
|
private |
◆ rfrIndex_
QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex_ |
|
private |
◆ spread_
◆ switchDate_
◆ useRfrCurve_