|
| 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 | +#include <qle/indexes/fallbackovernightindex.hpp> |
| 25 | + |
| 26 | +namespace QuantExt { |
| 27 | + |
| 28 | +FallbackOvernightIndex::FallbackOvernightIndex(const QuantLib::ext::shared_ptr<OvernightIndex> originalIndex, |
| 29 | + const QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex, const Real spread, |
| 30 | + const Date& switchDate, const bool useRfrCurve) |
| 31 | + : OvernightIndex(originalIndex->familyName(), originalIndex->fixingDays(), originalIndex->currency(), |
| 32 | + originalIndex->fixingCalendar(), originalIndex->dayCounter(), Handle<YieldTermStructure>()) { |
| 33 | + iborFallbackIndex_ = std::make_unique<FallbackIborIndex>(originalIndex, rfrIndex, spread, switchDate, useRfrCurve); |
| 34 | +} |
| 35 | + |
| 36 | +FallbackOvernightIndex::FallbackOvernightIndex(const QuantLib::ext::shared_ptr<OvernightIndex> originalIndex, |
| 37 | + const QuantLib::ext::shared_ptr<OvernightIndex> rfrIndex, const Real spread, |
| 38 | + const Date& switchDate, const Handle<YieldTermStructure>& forwardingCurve) |
| 39 | + : OvernightIndex(originalIndex->familyName(), originalIndex->fixingDays(), |
| 40 | + originalIndex->currency(), originalIndex->fixingCalendar(), |
| 41 | + originalIndex->dayCounter(), forwardingCurve) { |
| 42 | + iborFallbackIndex_ = std::make_unique<FallbackIborIndex>(originalIndex, rfrIndex, spread, switchDate, forwardingCurve); |
| 43 | +} |
| 44 | + |
| 45 | +} // namespace QuantExt |
0 commit comments