Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
iborfallbackconfig.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 ored/configuration/iborfallbackconfig.hpp
20 \brief ibor fallback configuration
21 \ingroup utilities
22*/
23
24#pragma once
25
27
28namespace ore {
29namespace data {
30
32public:
33 struct FallbackData {
34 string rfrIndex;
35 QuantLib::Real spread;
36 QuantLib::Date switchDate;
37 };
38
41 const bool useRfrCurveInSimulationMarket, const std::map<std::string, FallbackData>& fallbacks);
42
43 bool enableIborFallbacks() const;
44 bool useRfrCurveInTodaysMarket() const;
46
47 void addIndexFallbackRule(const string& iborIndex, const FallbackData& fallbackData);
48
49 bool isIndexReplaced(const string& iborIndex, const QuantLib::Date& asof = QuantLib::Date::maxDate()) const;
50 const FallbackData& fallbackData(const string& iborIndex) const;
51
52 void fromXML(XMLNode* node) override;
53 XMLNode* toXML(XMLDocument& doc) const override;
54
55 void clear();
57
58 /*! Update switch dates in the configuration to the targetSwitchDate
59 - either for the selected IBOR index only, or for all of them if indexName is left blank
60 - and skipping those where the current switch date is earlier than the target switch date
61 This is to facilitate testing without loading a custom fallback configuration.
62 */
63 void updateSwitchDate(QuantLib::Date targetSwitchDate, const std::string& indexName = "");
64 void logSwitchDates();
65private:
69 std::map<std::string, FallbackData> fallbacks_;
70};
71
72} // namespace data
73} // namespace ore
void updateSwitchDate(QuantLib::Date targetSwitchDate, const std::string &indexName="")
const FallbackData & fallbackData(const string &iborIndex) const
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
std::map< std::string, FallbackData > fallbacks_
static IborFallbackConfig defaultConfig()
bool isIndexReplaced(const string &iborIndex, const QuantLib::Date &asof=QuantLib::Date::maxDate()) const
void addIndexFallbackRule(const string &iborIndex, const FallbackData &fallbackData)
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
XML utility functions.