Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fallbackovernightindex.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/fallbackovernightindex.hpp
20 \brief wrapper class for overnight 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 FallbackOvernightIndex : public QuantLib::OvernightIndex {
36public:
37 FallbackOvernightIndex(const QuantLib::ext::shared_ptr<OvernightIndex> originalIndex,
38 const QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex, const Real spread, const Date& switchDate,
39 const bool useRfrCurve);
40 FallbackOvernightIndex(const QuantLib::ext::shared_ptr<OvernightIndex> 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<OvernightIndex> originalIndex() const;
50 QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex() const;
51 Real spread() const;
52 const Date& switchDate() const;
53 bool useRfrCurve() const;
54
55private:
56 Rate forecastFixing(const Date& valueDate, const Date& endDate, Time t) const override;
57 QuantLib::ext::shared_ptr<OvernightIndex> originalIndex_;
58 QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex_;
59 Real spread_;
62};
63
64} // namespace QuantExt
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_
Real fixing(const Date &fixingDate, bool forecastTodaysFixing=false) const override
coupon paying the compounded daily overnight rate, copy of QL class, added includeSpread flag