Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
correlationcurveconfig.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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/swaptionvolcurveconfig.hpp
20 \brief Swaption volatility curve configuration classes
21 \ingroup configuration
22*/
23
24#pragma once
25
28#include <ql/time/calendar.hpp>
29#include <ql/time/daycounter.hpp>
30#include <ql/time/period.hpp>
31#include <ql/types.hpp>
32
33namespace ore {
34namespace data {
36using QuantLib::BusinessDayConvention;
38using QuantLib::DayCounter;
39using QuantLib::Null;
40using QuantLib::Period;
41using QuantLib::Spread;
42using std::string;
43using std::vector;
44
45//! Correlation curve configuration
46/*!
47 \ingroup configuration
48*/
50public:
51 //! supported Correlation types
53 //! supported Correlation dimensions
54 enum class Dimension { ATM, Constant };
55
56 //! \name Constructors/Destructors
57 //@{
58 //! Default constructor
60 //! Detailed constructor
61 CorrelationCurveConfig(const string& curveID, const string& curveDescription, const Dimension& dimension,
62 const CorrelationType& corrType, const string& conventions, const MarketDatum::QuoteType& quoteType,
63 const bool extrapolate, const vector<string>& optionTenors, const DayCounter& dayCounter,
64 const Calendar& calendar, const BusinessDayConvention& businessDayConvention,
65 const string& index1, const string& index2, const string& currency,
66 const string& swaptionVol = "", const string& discountCurve = "");
67 //@}
68
69 //! \name Serialisation
70 //@{
71 void fromXML(XMLNode* node) override;
72 XMLNode* toXML(XMLDocument& doc) const override;
73 //@}
74
75 //! \name Inspectors
76 //@{
78 const string& conventions() const { return conventions_; }
79 const Dimension& dimension() const { return dimension_; }
80 const MarketDatum::QuoteType& quoteType() const { return quoteType_; }
81 const bool& extrapolate() const { return extrapolate_; }
82 const vector<string>& optionTenors() const { return optionTenors_; }
83 const DayCounter& dayCounter() const { return dayCounter_; }
84 const Calendar& calendar() const { return calendar_; }
85 const BusinessDayConvention& businessDayConvention() const { return businessDayConvention_; }
86 const string& index1() const { return index1_; }
87 const string& index2() const { return index2_; }
88 const string& currency() const { return currency_; }
89 const string& swaptionVolatility() const { return swaptionVol_; }
90 const string& discountCurve() const { return discountCurve_; }
91 const vector<string>& quotes() override;
92
93 //@}
94
95 //! \name Setters
96 //@{
98 string& conventions() { return conventions_; }
101 bool& extrapolate() { return extrapolate_; }
102 vector<string>& optionTenors() { return optionTenors_; }
103 DayCounter& dayCounter() { return dayCounter_; }
104 Calendar& calendar() { return calendar_; }
105 string& index1() { return index1_; }
106 string& index2() { return index2_; }
107 string& currency() { return currency_; }
108 string& swaptionVolatility() { return swaptionVol_; }
109 string& discountCurve() { return discountCurve_; }
110
111 //@}
112
113private:
115
121 vector<string> optionTenors_;
122 DayCounter dayCounter_;
123 Calendar calendar_;
124 BusinessDayConvention businessDayConvention_;
126 string currency_;
129};
130
131// Correlation pairs ordering, by convention we use pairs Index1:Index2 with
132// Index2 < Index1, where the ordering on index names is defined via
133// 1) CMS > Ibor > FX > EQ > COM
134// 2) Tenor
135// 3) currency / name (alphabetical)
136// Eg. EUR-CMS-10Y:GBP-LIBOR-6M, GBP-LIBOR-6M:FX-ECB-EUR-USD,
137// EUR-CMS-10Y:EUR-CMS-2Y, GBP-CMS-10Y:EUR-CMS-2Y
138bool indexNameLessThan(const std::string& index1, const std::string& index2);
139
140} // namespace data
141} // namespace ore
Correlation curve configuration.
const vector< string > & optionTenors() const
const MarketDatum::QuoteType & quoteType() const
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
const vector< string > & quotes() override
Return all the market quotes required for this config.
CorrelationType
supported Correlation types
const CorrelationType & correlationType() const
const BusinessDayConvention & businessDayConvention() const
Dimension
supported Correlation dimensions
Base curve configuration.
Definition: curveconfig.hpp:41
const string & curveDescription() const
Definition: curveconfig.hpp:55
const string & curveID() const
Definition: curveconfig.hpp:54
QuoteType
Supported market quote types.
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base curve configuration classes.
@ data
Definition: log.hpp:77
Market data representation.
bool indexNameLessThan(const std::string &index1, const std::string &index2)
Serializable Credit Default Swap.
Definition: namespaces.docs:23