Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fallbackiborindex.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file qle/indexes/fallbackiborindex.hpp
20 \brief wrapper class for ibor index managing the fallback rules
21 \ingroup indexes
22*/
23
24#pragma once
25
27
28#include <ql/indexes/iborindex.hpp>
29
30#include <vector>
31
32namespace QuantExt {
33using namespace QuantLib;
34
35class FallbackIborIndex : public QuantLib::IborIndex {
36public:
37 FallbackIborIndex(const QuantLib::ext::shared_ptr<IborIndex> originalIndex,
38 const QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex, const Real spread, const Date& switchDate,
39 const bool useRfrCurve);
40 FallbackIborIndex(const QuantLib::ext::shared_ptr<IborIndex> originalIndex,
41 const QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex, const Real spread, const Date& switchDate,
42 const Handle<YieldTermStructure>& forwardingCurve);
43
44 void addFixing(const Date& fixingDate, Real fixing, bool forceOverwrite = false) override;
45 Real fixing(const Date& fixingDate, bool forecastTodaysFixing = false) const override;
46 Rate pastFixing(const Date& fixingDate) const override;
47 QuantLib::ext::shared_ptr<IborIndex> clone(const Handle<YieldTermStructure>& forwarding) const override;
48
49 QuantLib::ext::shared_ptr<IborIndex> originalIndex() const;
50 QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex() const;
51 Real spread() const;
52 const Date& switchDate() const;
53
54 QuantLib::ext::shared_ptr<OvernightIndexedCoupon> onCoupon(const Date& iborFixingDate,
55 const bool telescopicValueDates = false) const;
56
57private:
58 Rate forecastFixing(const Date& valueDate, const Date& endDate, Time t) const override;
59 QuantLib::ext::shared_ptr<IborIndex> originalIndex_;
60 QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex_;
61 Real spread_;
63};
64
65} // namespace QuantExt
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
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
coupon paying the compounded daily overnight rate, copy of QL class, added includeSpread flag