Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
genericyieldvolcurveconfig.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/genericyieldvolcurveconfig.hpp
20 \brief Swaption volatility curve configuration classes
21 \ingroup configuration
22*/
23
24#pragma once
25
29#include <ql/time/calendar.hpp>
30#include <ql/time/daycounter.hpp>
31#include <ql/time/period.hpp>
32#include <ql/types.hpp>
33
34namespace ore {
35namespace data {
37using QuantLib::BusinessDayConvention;
39using QuantLib::DayCounter;
40using QuantLib::Period;
41using QuantLib::Spread;
42using std::string;
43using std::vector;
44
45//! Generic yield volatility curve configuration class
46/*!
47 \ingroup configuration
48*/
50public:
51 //! supported volatility dimensions
52 enum class Dimension { ATM, Smile };
53 // supported volatility types
55 // supported interpolations (codes are consistent with QuantExt::SabrParametricVolatility::ModelVariant)
56 enum class Interpolation {
63 Linear = 6
64 };
65 // supported extrapolations
66 enum class Extrapolation {
68 };
69
70 //! \name Constructors/Destructors
71 //@{
72 //! Default constructor
73 GenericYieldVolatilityCurveConfig(const std::string& underlyingLabel, const std::string& rootNodeLabel,
74 const std::string& marketDatumInstrumentLabel, const std::string& qualifierLabel,
75 const bool allowSmile,
76 const bool requireSwapIndexBases) : underlyingLabel_(underlyingLabel),
77 rootNodeLabel_(rootNodeLabel), marketDatumInstrumentLabel_(marketDatumInstrumentLabel),
78 qualifierLabel_(qualifierLabel), allowSmile_(allowSmile), requireSwapIndexBases_(requireSwapIndexBases) {}
79 //! Detailed constructor
81 const std::string& underlyingLabel, const std::string& rootNodeLabel,
82 const std::string& marketDatumInstrumentLabel, const std::string& qualifierLabel, const string& curveID,
83 const string& curveDescription, const string& qualifier, const Dimension dimension,
85 const Interpolation interpolation, const Extrapolation extrapolation, const vector<string>& optionTenors,
86 const vector<string>& underlyingTenors, const DayCounter& dayCounter, const Calendar& calendar,
87 const BusinessDayConvention& businessDayConvention, const string& shortSwapIndexBase = "",
88 const string& swapIndexBase = "",
89 // Only required for smile
90 const vector<string>& smileOptionTenors = vector<string>(),
91 const vector<string>& smileUnderlyingTenors = vector<string>(),
92 const vector<string>& smileSpreads = vector<string>(),
93 const boost::optional<ParametricSmileConfiguration>& parametricSmileConfiguration = boost::none);
94 //! Detailed contructor for proxy config
95 GenericYieldVolatilityCurveConfig(const std::string& underlyingLabel, const std::string& rootNodeLabel,
96 const std::string& qualifierLabel, const string& curveID,
97 const string& curveDescription, const string& qualifier,
98 const std::string& proxySourceCurveId,
99 const std::string& proxySourceShortSwapIndexBase,
100 const std::string& proxySourceSwapIndexBase,
101 const std::string& proxyTargetShortSwapIndexBase,
102 const std::string& proxyTargetSwapIndexBase);
103
104 //@}
105
106 //! \name Serialisation
107 //@{
108 void fromXML(XMLNode* node) override;
109 XMLNode* toXML(XMLDocument& doc) const override;
110 //@}
111
112 //! \name Inspectors
113 //@{
114 const string& qualifier() const { return qualifier_; }
115 Dimension dimension() const { return dimension_; }
120 const vector<string>& optionTenors() const { return optionTenors_; }
121 const vector<string>& underlyingTenors() const { return underlyingTenors_; }
122 const DayCounter& dayCounter() const { return dayCounter_; }
123 const Calendar& calendar() const { return calendar_; }
124 const BusinessDayConvention& businessDayConvention() const { return businessDayConvention_; }
125 const string& shortSwapIndexBase() const { return shortSwapIndexBase_; }
126 const string& swapIndexBase() const { return swapIndexBase_; }
127 const vector<string>& smileOptionTenors() const { return smileOptionTenors_; }
128 const vector<string>& smileUnderlyingTenors() const { return smileUnderlyingTenors_; }
129 const vector<string>& smileSpreads() const { return smileSpreads_; }
130 const string& quoteTag() const { return quoteTag_; }
131 const vector<string>& quotes() override;
132 //
133 const std::string& proxySourceCurveId() const { return proxySourceCurveId_; }
135 const std::string& proxySourceSwapIndexBase() const { return proxySourceSwapIndexBase_; }
137 const std::string& proxyTargetSwapIndexBase() const { return proxyTargetSwapIndexBase_; }
138 //
139 const boost::optional<ParametricSmileConfiguration> parametricSmileConfiguration() const {
141 }
142 //
143 const ReportConfig& reportConfig() const { return reportConfig_; }
144 //@}
145
146 //! \name Setters
147 //@{
148 string& qualifier() { return qualifier_; }
154 vector<string>& optionTenors() { return optionTenors_; }
155 vector<string>& underlyingTenors() { return underlyingTenors_; }
156 DayCounter& dayCounter() { return dayCounter_; }
157 Calendar& calendar() { return calendar_; }
158 BusinessDayConvention& businessDayConvention() { return businessDayConvention_; }
160 string& swapIndexBase() { return swapIndexBase_; }
161 vector<string>& smileOptionTenors() { return smileOptionTenors_; }
162 vector<string>& smileUnderlyingTenors() { return smileUnderlyingTenors_; }
163 vector<string>& smileSpreads() { return smileSpreads_; }
164 string& quoteTag() { return quoteTag_; }
165 //@}
166
167private:
169 string ccyFromSwapIndexBase(const std::string& swapIndexBase);
170 //
173 //
181 DayCounter dayCounter_;
182 Calendar calendar_;
183 BusinessDayConvention businessDayConvention_;
185 vector<string> smileOptionTenors_;
187 vector<string> smileSpreads_;
188 string quoteTag_;
189
195
196 boost::optional<ParametricSmileConfiguration> parametricSmileConfiguration_;
197
199};
200
201std::ostream& operator<<(std::ostream& out, GenericYieldVolatilityCurveConfig::VolatilityType t);
202
203} // namespace data
204} // namespace ore
Base curve configuration.
Definition: curveconfig.hpp:41
const string & curveDescription() const
Definition: curveconfig.hpp:55
const string & curveID() const
Definition: curveconfig.hpp:54
Generic yield volatility curve configuration class.
const boost::optional< ParametricSmileConfiguration > parametricSmileConfiguration() const
GenericYieldVolatilityCurveConfig(const std::string &underlyingLabel, const std::string &rootNodeLabel, const std::string &marketDatumInstrumentLabel, const std::string &qualifierLabel, const bool allowSmile, const bool requireSwapIndexBases)
Default constructor.
string ccyFromSwapIndexBase(const std::string &swapIndexBase)
XMLNode * toXML(XMLDocument &doc) const override
const vector< string > & quotes() override
Return all the market quotes required for this config.
boost::optional< ParametricSmileConfiguration > parametricSmileConfiguration_
const BusinessDayConvention & businessDayConvention() const
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base curve configuration classes.
@ data
Definition: log.hpp:77
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
Extrapolation
Enumeration for holding various extrapolation settings.
Definition: parsers.hpp:450
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Class for holding parametric smile configurations.
md report and arbitrage check configuration