Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Types | List of all members
GenericYieldVolatilityCurveConfig Class Reference

Generic yield volatility curve configuration class. More...

#include <ored/configuration/genericyieldvolcurveconfig.hpp>

+ Inheritance diagram for GenericYieldVolatilityCurveConfig:
+ Collaboration diagram for GenericYieldVolatilityCurveConfig:

Public Types

enum class  Dimension { ATM , Smile }
 supported volatility dimensions More...
 
enum class  VolatilityType { Lognormal , Normal , ShiftedLognormal }
 
enum class  Interpolation {
  Hagan2002Lognormal = 0 , Hagan2002Normal = 1 , Hagan2002NormalZeroBeta = 2 , Antonov2015FreeBoundaryNormal =3 ,
  KienitzLawsonSwaynePde =4 , FlochKennedy =5 , Linear = 6
}
 
enum class  Extrapolation { None , Flat , Linear }
 

Public Member Functions

Constructors/Destructors
 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. More...
 
 GenericYieldVolatilityCurveConfig (const std::string &underlyingLabel, const std::string &rootNodeLabel, const std::string &marketDatumInstrumentLabel, const std::string &qualifierLabel, const string &curveID, const string &curveDescription, const string &qualifier, const Dimension dimension, const VolatilityType volatilityType, const VolatilityType outputVolatilityType, const Interpolation interpolation, const Extrapolation extrapolation, const vector< string > &optionTenors, const vector< string > &underlyingTenors, const DayCounter &dayCounter, const Calendar &calendar, const BusinessDayConvention &businessDayConvention, const string &shortSwapIndexBase="", const string &swapIndexBase="", const vector< string > &smileOptionTenors=vector< string >(), const vector< string > &smileUnderlyingTenors=vector< string >(), const vector< string > &smileSpreads=vector< string >(), const boost::optional< ParametricSmileConfiguration > &parametricSmileConfiguration=boost::none)
 Detailed constructor. More...
 
 GenericYieldVolatilityCurveConfig (const std::string &underlyingLabel, const std::string &rootNodeLabel, const std::string &qualifierLabel, const string &curveID, const string &curveDescription, const string &qualifier, const std::string &proxySourceCurveId, const std::string &proxySourceShortSwapIndexBase, const std::string &proxySourceSwapIndexBase, const std::string &proxyTargetShortSwapIndexBase, const std::string &proxyTargetSwapIndexBase)
 Detailed contructor for proxy config. More...
 
Serialisation
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 
Inspectors
const string & qualifier () const
 
Dimension dimension () const
 
VolatilityType volatilityType () const
 
VolatilityType outputVolatilityType () const
 
Interpolation interpolation () const
 
Extrapolation extrapolation () const
 
const vector< string > & optionTenors () const
 
const vector< string > & underlyingTenors () const
 
const DayCounter & dayCounter () const
 
const Calendar & calendar () const
 
const BusinessDayConvention & businessDayConvention () const
 
const string & shortSwapIndexBase () const
 
const string & swapIndexBase () const
 
const vector< string > & smileOptionTenors () const
 
const vector< string > & smileUnderlyingTenors () const
 
const vector< string > & smileSpreads () const
 
const string & quoteTag () const
 
const vector< string > & quotes () override
 Return all the market quotes required for this config. More...
 
const std::string & proxySourceCurveId () const
 
const std::string & proxySourceShortSwapIndexBase () const
 
const std::string & proxySourceSwapIndexBase () const
 
const std::string & proxyTargetShortSwapIndexBase () const
 
const std::string & proxyTargetSwapIndexBase () const
 
const boost::optional< ParametricSmileConfigurationparametricSmileConfiguration () const
 
const ReportConfigreportConfig () const
 
- Public Member Functions inherited from CurveConfig
 CurveConfig (const string &curveID, const string &curveDescription, const vector< string > &quotes=vector< string >())
 Detailed constructor. More...
 
 CurveConfig ()
 Default constructor. More...
 
const string & curveID () const
 
const string & curveDescription () const
 
const set< string > & requiredCurveIds (const CurveSpec::CurveType &curveType) const
 
const map< CurveSpec::CurveType, set< string > > & requiredCurveIds () const
 
string & curveID ()
 
string & curveDescription ()
 
set< string > & requiredCurveIds (const CurveSpec::CurveType &curveType)
 
map< CurveSpec::CurveType, set< string > > & requiredCurveIds ()
 
- Public Member Functions inherited from XMLSerializable
virtual ~XMLSerializable ()
 
virtual void fromXML (XMLNode *node)=0
 
virtual XMLNodetoXML (XMLDocument &doc) const =0
 
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename) const
 
void fromXMLString (const std::string &xml)
 Parse from XML string. More...
 
std::string toXMLString () const
 Parse from XML string. More...
 

Setters

const string underlyingLabel_
 
const string rootNodeLabel_
 
const string marketDatumInstrumentLabel_
 
const string qualifierLabel_
 
const bool allowSmile_
 
const bool requireSwapIndexBases_
 
string qualifier_
 
Dimension dimension_ = Dimension::Smile
 
VolatilityType volatilityType_ = VolatilityType::Normal
 
VolatilityType outputVolatilityType_ = VolatilityType::Normal
 
Interpolation interpolation_ = Interpolation::Linear
 
Extrapolation extrapolation_ = Extrapolation::Flat
 
vector< string > optionTenors_
 
vector< string > underlyingTenors_
 
DayCounter dayCounter_
 
Calendar calendar_
 
BusinessDayConvention businessDayConvention_
 
string shortSwapIndexBase_
 
string swapIndexBase_
 
vector< string > smileOptionTenors_
 
vector< string > smileUnderlyingTenors_
 
vector< string > smileSpreads_
 
string quoteTag_
 
string proxySourceCurveId_
 
string proxySourceShortSwapIndexBase_
 
string proxySourceSwapIndexBase_
 
string proxyTargetShortSwapIndexBase_
 
string proxyTargetSwapIndexBase_
 
boost::optional< ParametricSmileConfigurationparametricSmileConfiguration_
 
ReportConfig reportConfig_
 
string & qualifier ()
 
Dimensiondimension ()
 
VolatilityTypevolatilityType ()
 
VolatilityTypeoutputVolatilityType ()
 
Interpolationinterpolation ()
 
Extrapolationextrapolation ()
 
vector< string > & optionTenors ()
 
vector< string > & underlyingTenors ()
 
DayCounter & dayCounter ()
 
Calendar & calendar ()
 
BusinessDayConvention & businessDayConvention ()
 
string & shortSwapIndexBase ()
 
string & swapIndexBase ()
 
vector< string > & smileOptionTenors ()
 
vector< string > & smileUnderlyingTenors ()
 
vector< string > & smileSpreads ()
 
string & quoteTag ()
 
void populateRequiredCurveIds ()
 
string ccyFromSwapIndexBase (const std::string &swapIndexBase)
 

Additional Inherited Members

- Protected Attributes inherited from CurveConfig
string curveID_
 
string curveDescription_
 
vector< string > quotes_
 
map< CurveSpec::CurveType, set< string > > requiredCurveIds_
 

Detailed Description

Generic yield volatility curve configuration class.

Definition at line 49 of file genericyieldvolcurveconfig.hpp.

Member Enumeration Documentation

◆ Dimension

enum class Dimension
strong

supported volatility dimensions

Enumerator
ATM 
Smile 

Definition at line 52 of file genericyieldvolcurveconfig.hpp.

◆ VolatilityType

enum class VolatilityType
strong

◆ Interpolation

enum class Interpolation
strong

◆ Extrapolation

enum class Extrapolation
strong

Constructor & Destructor Documentation

◆ GenericYieldVolatilityCurveConfig() [1/3]

GenericYieldVolatilityCurveConfig ( const std::string &  underlyingLabel,
const std::string &  rootNodeLabel,
const std::string &  marketDatumInstrumentLabel,
const std::string &  qualifierLabel,
const bool  allowSmile,
const bool  requireSwapIndexBases 
)

◆ GenericYieldVolatilityCurveConfig() [2/3]

GenericYieldVolatilityCurveConfig ( const std::string &  underlyingLabel,
const std::string &  rootNodeLabel,
const std::string &  marketDatumInstrumentLabel,
const std::string &  qualifierLabel,
const string &  curveID,
const string &  curveDescription,
const string &  qualifier,
const Dimension  dimension,
const VolatilityType  volatilityType,
const VolatilityType  outputVolatilityType,
const Interpolation  interpolation,
const Extrapolation  extrapolation,
const vector< string > &  optionTenors,
const vector< string > &  underlyingTenors,
const DayCounter &  dayCounter,
const Calendar &  calendar,
const BusinessDayConvention &  businessDayConvention,
const string &  shortSwapIndexBase = "",
const string &  swapIndexBase = "",
const vector< string > &  smileOptionTenors = vector<string>(),
const vector< string > &  smileUnderlyingTenors = vector<string>(),
const vector< string > &  smileSpreads = vector<string>(),
const boost::optional< ParametricSmileConfiguration > &  parametricSmileConfiguration = boost::none 
)

Detailed constructor.

Definition at line 44 of file genericyieldvolcurveconfig.cpp.

54 : CurveConfig(curveID, curveDescription), underlyingLabel_(underlyingLabel), rootNodeLabel_(rootNodeLabel),
55 marketDatumInstrumentLabel_(marketDatumInstrumentLabel), qualifierLabel_(qualifierLabel), allowSmile_(true),
63
64 QL_REQUIRE(dimension == Dimension::ATM || dimension == Dimension::Smile, "Invalid dimension");
65
67 QL_REQUIRE(smileOptionTenors.size() == 0 && smileUnderlyingTenors.size() == 0 && smileSpreads.size() == 0,
68 "Smile tenors/strikes/spreads should only be set when dim=Smile");
69 }
70
71 if (qualifier_.empty()) {
73 }
74}
const string & curveDescription() const
Definition: curveconfig.hpp:55
const string & curveID() const
Definition: curveconfig.hpp:54
CurveConfig()
Default constructor.
Definition: curveconfig.hpp:49
const boost::optional< ParametricSmileConfiguration > parametricSmileConfiguration() const
string ccyFromSwapIndexBase(const std::string &swapIndexBase)
boost::optional< ParametricSmileConfiguration > parametricSmileConfiguration_
const BusinessDayConvention & businessDayConvention() const
+ Here is the call graph for this function:

◆ GenericYieldVolatilityCurveConfig() [3/3]

GenericYieldVolatilityCurveConfig ( const std::string &  underlyingLabel,
const std::string &  rootNodeLabel,
const std::string &  qualifierLabel,
const string &  curveID,
const string &  curveDescription,
const string &  qualifier,
const std::string &  proxySourceCurveId,
const std::string &  proxySourceShortSwapIndexBase,
const std::string &  proxySourceSwapIndexBase,
const std::string &  proxyTargetShortSwapIndexBase,
const std::string &  proxyTargetSwapIndexBase 
)

Detailed contructor for proxy config.

Definition at line 76 of file genericyieldvolcurveconfig.cpp.

82 : CurveConfig(curveID, curveDescription), underlyingLabel_(underlyingLabel), rootNodeLabel_(rootNodeLabel),
83 qualifierLabel_(qualifierLabel), allowSmile_(true), requireSwapIndexBases_(false),
88
89 if (qualifier_.empty()) {
91 }
92
94}
+ Here is the call graph for this function:

Member Function Documentation

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 155 of file genericyieldvolcurveconfig.cpp.

155 {
157
158 curveID_ = XMLUtils::getChildValue(node, "CurveId", true);
159 curveDescription_ = XMLUtils::getChildValue(node, "CurveDescription", true);
160
161 if (auto p = XMLUtils::getChildNode(node, "ProxyConfig")) {
162 // read in proxy config
163
164 auto source = XMLUtils::getChildNode(p, "Source");
165 QL_REQUIRE(source != nullptr,
166 "GenericYieldVolatilityCurveConfig::fromXML(): ProxyConfig requires child node 'Source'");
167 proxySourceCurveId_ = XMLUtils::getChildValue(source, "CurveId");
168 proxySourceShortSwapIndexBase_ = XMLUtils::getChildValue(source, "ShortSwapIndexBase");
169 proxySourceSwapIndexBase_ = XMLUtils::getChildValue(source, "SwapIndexBase");
170
171 auto target = XMLUtils::getChildNode(p, "Target");
172 QL_REQUIRE(target != nullptr,
173 "GenericYieldVolatilityCurveConfig::fromXML(): ProxyConfig requires child node 'Target'");
174 proxyTargetShortSwapIndexBase_ = XMLUtils::getChildValue(target, "ShortSwapIndexBase");
175 proxyTargetSwapIndexBase_ = XMLUtils::getChildValue(target, "SwapIndexBase");
176
178
179 } else {
180 // read in quote-based config
181 if (allowSmile_) {
182 string dim = XMLUtils::getChildValue(node, "Dimension", true);
183 if (dim == "ATM") {
185 } else if (dim == "Smile") {
187 } else {
188 QL_FAIL("Dimension " << dim << " not recognized");
189 }
190 } else {
192 }
193
194 string volType = XMLUtils::getChildValue(node, "VolatilityType", true);
195 if (volType == "Normal") {
197 } else if (volType == "Lognormal") {
199 } else if (volType == "ShiftedLognormal") {
201 } else {
202 QL_FAIL(
203 "VolatilityType '" << volType
204 << "' not recognized. Expected one of 'Normal', 'Lognormal', 'ShiftedLognormal'.");
205 }
206
207 string outVolType = XMLUtils::getChildValue(node, "OutputVolatilityType", false);
208 if (outVolType.empty())
210 else if (outVolType == "Normal") {
212 } else if (outVolType == "Lognormal") {
214 } else if (outVolType == "ShiftedLognormal") {
216 } else {
217 QL_FAIL("OutputVolatilityType '"
218 << outVolType << "' not recognized. Expected one of 'Normal', 'Lognormal', 'ShiftedLognormal'.");
219 }
220
221 string interp = XMLUtils::getChildValue(node, "Interpolation", false, "Linear");
222 if (interp == "Linear") {
224 } else {
225 try {
227 } catch (const std::exception& e) {
228 QL_FAIL("Interpolation '" << interp << "' not recognized. Expected 'Linear' or a SABR variant ("
229 << e.what() << ")");
230 }
231 }
232
233 string extr = XMLUtils::getChildValue(node, "Extrapolation", false, "Flat");
234 if (extr == "Linear") {
236 } else if (extr == "Flat") {
238 } else if (extr == "None") {
240 } else {
241 QL_FAIL("Extrapolation " << extr << " not recognized, expected one of 'Linear', 'Flat', 'None'.");
242 }
243
244 optionTenors_ = XMLUtils::getChildrenValuesAsStrings(node, "OptionTenors", true);
246
247 string cal = XMLUtils::getChildValue(node, "Calendar", true);
249
250 string dc = XMLUtils::getChildValue(node, "DayCounter", true);
252
253 string bdc = XMLUtils::getChildValue(node, "BusinessDayConvention", true);
255
257 shortSwapIndexBase_ = XMLUtils::getChildValue(node, "ShortSwapIndexBase", true);
258 swapIndexBase_ = XMLUtils::getChildValue(node, "SwapIndexBase", true);
259 }
260
261 // smile data
263 smileOptionTenors_ = XMLUtils::getChildrenValuesAsStrings(node, "SmileOptionTenors", true);
265 XMLUtils::getChildrenValuesAsStrings(node, "Smile" + underlyingLabel_ + "Tenors", true);
266 smileSpreads_ = XMLUtils::getChildrenValuesAsStrings(node, "SmileSpreads", true);
267 }
268
269 // read qualifier from explicit field
270 if (qualifierLabel_ != "")
272
273 // derive qualifier (=ccy) from swapIndexBase if not given explicitly
274 if (qualifier_ == "")
276
277 // optional quote tag to include
278 quoteTag_ = XMLUtils::getChildValue(node, "QuoteTag", false);
279
280 // Optional parametric smile configuration
281 if(XMLNode* n = XMLUtils::getChildNode(node, "ParametricSmileConfiguration")) {
282 parametricSmileConfiguration_ = ParametricSmileConfiguration();
284 }
285 }
286
287 if (auto tmp = XMLUtils::getChildNode(node, "Report")) {
289 }
290}
void fromXML(XMLNode *node) override
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static vector< string > getChildrenValuesAsStrings(XMLNode *node, const string &name, bool mandatory=false)
Definition: xmlutils.cpp:342
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
Definition: parsers.cpp:157
SabrParametricVolatility::ModelVariant parseSabrParametricVolatilityModelVariant(const std::string &s)
Parse SabrParametricVolatility::ModelVariant.
Definition: parsers.cpp:1458
BusinessDayConvention parseBusinessDayConvention(const string &s)
Convert text to QuantLib::BusinessDayConvention.
Definition: parsers.cpp:173
DayCounter parseDayCounter(const string &s)
Convert text to QuantLib::DayCounter.
Definition: parsers.cpp:209
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 292 of file genericyieldvolcurveconfig.cpp.

292 {
293 XMLNode* node = doc.allocNode(rootNodeLabel_);
294 XMLUtils::addChild(doc, node, "CurveId", curveID_);
295 XMLUtils::addChild(doc, node, "CurveDescription", curveDescription_);
296
297 if (!proxySourceCurveId_.empty()) {
298 // write out proxy config
299 auto proxy = XMLUtils::addChild(doc, node, "ProxyConfig");
300 auto source = XMLUtils::addChild(doc, proxy, "Source");
301 auto target = XMLUtils::addChild(doc, proxy, "Target");
302 XMLUtils::addChild(doc, source, "CurveId", proxySourceCurveId_);
303 XMLUtils::addChild(doc, source, "ShortSwapIndexBase", proxySourceShortSwapIndexBase_);
304 XMLUtils::addChild(doc, source, "SwapIndexBase", proxySourceSwapIndexBase_);
305 XMLUtils::addChild(doc, target, "ShortSwapIndexBase", proxyTargetShortSwapIndexBase_);
306 XMLUtils::addChild(doc, target, "SwapIndexBase", proxyTargetSwapIndexBase_);
307 } else {
308 // write out quote based config
309 if (qualifierLabel_ != "")
311
312 if (dimension_ == Dimension::ATM) {
313 XMLUtils::addChild(doc, node, "Dimension", "ATM");
314 } else if (dimension_ == Dimension::Smile) {
315 XMLUtils::addChild(doc, node, "Dimension", "Smile");
316 } else {
317 QL_FAIL("Unknown Dimension in GenericYieldVolatilityCurveConfig::toXML()");
318 }
319
321 XMLUtils::addChild(doc, node, "VolatilityType", "Normal");
323 XMLUtils::addChild(doc, node, "VolatilityType", "Lognormal");
325 XMLUtils::addChild(doc, node, "VolatilityType", "ShiftedLognormal");
326 } else {
327 QL_FAIL("Unknown VolatilityType in GenericYieldVolatilityCurveConfig::toXML()");
328 }
329
331 XMLUtils::addChild(doc, node, "OutputVolatilityType", "Normal");
333 XMLUtils::addChild(doc, node, "OutputVolatilityType", "Lognormal");
335 XMLUtils::addChild(doc, node, "OutputVolatilityType", "ShiftedLognormal");
336 } else {
337 QL_FAIL("Unknown OutputVolatilityType in GenericYieldVolatilityCurveConfig::toXML()");
338 }
339
340 std::string extr_string;
342 extr_string = "None";
344 extr_string = "Linear";
345 } else if (extrapolation_ == Extrapolation::Flat) {
346 extr_string = "Flat";
347 }
348 XMLUtils::addChild(doc, node, "Extrapolation", extr_string);
349
350 XMLUtils::addChild(doc, node, "DayCounter", to_string(dayCounter_));
351 XMLUtils::addChild(doc, node, "Calendar", to_string(calendar_));
352 XMLUtils::addChild(doc, node, "BusinessDayConvention", to_string(businessDayConvention_));
353 XMLUtils::addGenericChildAsList(doc, node, "OptionTenors", optionTenors_);
355
357 XMLUtils::addChild(doc, node, "ShortSwapIndexBase", shortSwapIndexBase_);
358 XMLUtils::addChild(doc, node, "SwapIndexBase", swapIndexBase_);
359 }
360
362 XMLUtils::addGenericChildAsList(doc, node, "SmileOptionTenors", smileOptionTenors_);
364 XMLUtils::addGenericChildAsList(doc, node, "SmileSpreads", smileSpreads_);
365 }
366
367 if (!quoteTag_.empty()) {
368 XMLUtils::addChild(doc, node, "QuoteTag", quoteTag_);
369 }
370 }
371
373
374 return node;
375}
XMLNode * toXML(XMLDocument &doc) const override
static void addGenericChildAsList(XMLDocument &doc, XMLNode *n, const string &name, const vector< T > &values, const string &attrName="", const string &attr="")
Definition: xmlutils.hpp:144
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function:

◆ qualifier() [1/2]

const string & qualifier ( ) const

Definition at line 114 of file genericyieldvolcurveconfig.hpp.

114{ return qualifier_; }

◆ dimension() [1/2]

Dimension dimension ( ) const

Definition at line 115 of file genericyieldvolcurveconfig.hpp.

115{ return dimension_; }
+ Here is the caller graph for this function:

◆ volatilityType() [1/2]

VolatilityType volatilityType ( ) const

Definition at line 116 of file genericyieldvolcurveconfig.hpp.

116{ return volatilityType_; }

◆ outputVolatilityType() [1/2]

VolatilityType outputVolatilityType ( ) const

Definition at line 117 of file genericyieldvolcurveconfig.hpp.

117{ return outputVolatilityType_; }

◆ interpolation() [1/2]

Interpolation interpolation ( ) const

Definition at line 118 of file genericyieldvolcurveconfig.hpp.

118{ return interpolation_; }

◆ extrapolation() [1/2]

Extrapolation extrapolation ( ) const

Definition at line 119 of file genericyieldvolcurveconfig.hpp.

119{ return extrapolation_; }

◆ optionTenors() [1/2]

const vector< string > & optionTenors ( ) const

Definition at line 120 of file genericyieldvolcurveconfig.hpp.

120{ return optionTenors_; }

◆ underlyingTenors() [1/2]

const vector< string > & underlyingTenors ( ) const

Definition at line 121 of file genericyieldvolcurveconfig.hpp.

121{ return underlyingTenors_; }

◆ dayCounter() [1/2]

const DayCounter & dayCounter ( ) const

Definition at line 122 of file genericyieldvolcurveconfig.hpp.

122{ return dayCounter_; }

◆ calendar() [1/2]

const Calendar & calendar ( ) const

Definition at line 123 of file genericyieldvolcurveconfig.hpp.

123{ return calendar_; }

◆ businessDayConvention() [1/2]

const BusinessDayConvention & businessDayConvention ( ) const

Definition at line 124 of file genericyieldvolcurveconfig.hpp.

124{ return businessDayConvention_; }

◆ shortSwapIndexBase() [1/2]

const string & shortSwapIndexBase ( ) const

Definition at line 125 of file genericyieldvolcurveconfig.hpp.

125{ return shortSwapIndexBase_; }

◆ swapIndexBase() [1/2]

const string & swapIndexBase ( ) const

Definition at line 126 of file genericyieldvolcurveconfig.hpp.

126{ return swapIndexBase_; }
+ Here is the caller graph for this function:

◆ smileOptionTenors() [1/2]

const vector< string > & smileOptionTenors ( ) const

Definition at line 127 of file genericyieldvolcurveconfig.hpp.

127{ return smileOptionTenors_; }
+ Here is the caller graph for this function:

◆ smileUnderlyingTenors() [1/2]

const vector< string > & smileUnderlyingTenors ( ) const

Definition at line 128 of file genericyieldvolcurveconfig.hpp.

128{ return smileUnderlyingTenors_; }
+ Here is the caller graph for this function:

◆ smileSpreads() [1/2]

const vector< string > & smileSpreads ( ) const

Definition at line 129 of file genericyieldvolcurveconfig.hpp.

129{ return smileSpreads_; }
+ Here is the caller graph for this function:

◆ quoteTag() [1/2]

const string & quoteTag ( ) const

Definition at line 130 of file genericyieldvolcurveconfig.hpp.

130{ return quoteTag_; }

◆ quotes()

const vector< string > & quotes ( )
overridevirtual

Return all the market quotes required for this config.

Reimplemented from CurveConfig.

Definition at line 103 of file genericyieldvolcurveconfig.cpp.

103 {
104
105 if (quotes_.size() == 0 && proxySourceCurveId_.empty()) {
106 std::stringstream ssBase;
107 ssBase << marketDatumInstrumentLabel_ << "/" << volatilityType_ << "/" << qualifier_ << "/";
108 if (!quoteTag_.empty())
109 ssBase << quoteTag_ << "/";
110 string base = ssBase.str();
111
112 // add atm vols (always required)
113 for (auto o : optionTenors_) {
114 for (auto s : underlyingTenors_) {
115 std::stringstream ss;
116 ss << base << o << "/" << s << "/ATM";
117 quotes_.push_back(ss.str());
118 }
119 }
120
121 // add Smile Spreads, if dimension is Smile
123 for (auto o : smileOptionTenors_) {
124 for (auto s : smileUnderlyingTenors_) {
125 for (auto sp : smileSpreads_) {
126 std::stringstream ss;
127 ss << base << o << "/" << s << "/Smile/" << sp;
128 quotes_.push_back(ss.str());
129 }
130 }
131 }
132 }
133 // add SHIFT quotes, if vol type is SLN
134 for (auto s : underlyingTenors_) {
136 std::stringstream ss;
137 ss << marketDatumInstrumentLabel_ << "/SHIFT/" << qualifier_ << "/"
138 << (quoteTag_.empty() ? "" : quoteTag_ + "/") << s;
139 quotes_.push_back(ss.str());
140 }
141 }
142 }
143 return quotes_;
144}
vector< string > quotes_
Definition: curveconfig.hpp:74

◆ proxySourceCurveId()

const std::string & proxySourceCurveId ( ) const

Definition at line 133 of file genericyieldvolcurveconfig.hpp.

133{ return proxySourceCurveId_; }

◆ proxySourceShortSwapIndexBase()

const std::string & proxySourceShortSwapIndexBase ( ) const

Definition at line 134 of file genericyieldvolcurveconfig.hpp.

◆ proxySourceSwapIndexBase()

const std::string & proxySourceSwapIndexBase ( ) const

Definition at line 135 of file genericyieldvolcurveconfig.hpp.

◆ proxyTargetShortSwapIndexBase()

const std::string & proxyTargetShortSwapIndexBase ( ) const

Definition at line 136 of file genericyieldvolcurveconfig.hpp.

◆ proxyTargetSwapIndexBase()

const std::string & proxyTargetSwapIndexBase ( ) const

Definition at line 137 of file genericyieldvolcurveconfig.hpp.

◆ parametricSmileConfiguration()

const boost::optional< ParametricSmileConfiguration > parametricSmileConfiguration ( ) const

Definition at line 139 of file genericyieldvolcurveconfig.hpp.

139 {
141 }

◆ reportConfig()

const ReportConfig & reportConfig ( ) const

Definition at line 143 of file genericyieldvolcurveconfig.hpp.

143{ return reportConfig_; }

◆ qualifier() [2/2]

string & qualifier ( )

Definition at line 148 of file genericyieldvolcurveconfig.hpp.

148{ return qualifier_; }

◆ dimension() [2/2]

Dimension & dimension ( )

Definition at line 149 of file genericyieldvolcurveconfig.hpp.

149{ return dimension_; }

◆ volatilityType() [2/2]

VolatilityType & volatilityType ( )

Definition at line 150 of file genericyieldvolcurveconfig.hpp.

150{ return volatilityType_; }

◆ outputVolatilityType() [2/2]

VolatilityType & outputVolatilityType ( )

Definition at line 151 of file genericyieldvolcurveconfig.hpp.

151{ return outputVolatilityType_; }

◆ interpolation() [2/2]

Interpolation & interpolation ( )

Definition at line 152 of file genericyieldvolcurveconfig.hpp.

152{ return interpolation_; }

◆ extrapolation() [2/2]

Extrapolation & extrapolation ( )

Definition at line 153 of file genericyieldvolcurveconfig.hpp.

153{ return extrapolation_; }

◆ optionTenors() [2/2]

vector< string > & optionTenors ( )

Definition at line 154 of file genericyieldvolcurveconfig.hpp.

154{ return optionTenors_; }

◆ underlyingTenors() [2/2]

vector< string > & underlyingTenors ( )

Definition at line 155 of file genericyieldvolcurveconfig.hpp.

155{ return underlyingTenors_; }

◆ dayCounter() [2/2]

DayCounter & dayCounter ( )

Definition at line 156 of file genericyieldvolcurveconfig.hpp.

156{ return dayCounter_; }

◆ calendar() [2/2]

Calendar & calendar ( )

Definition at line 157 of file genericyieldvolcurveconfig.hpp.

157{ return calendar_; }

◆ businessDayConvention() [2/2]

BusinessDayConvention & businessDayConvention ( )

Definition at line 158 of file genericyieldvolcurveconfig.hpp.

158{ return businessDayConvention_; }

◆ shortSwapIndexBase() [2/2]

string & shortSwapIndexBase ( )

Definition at line 159 of file genericyieldvolcurveconfig.hpp.

159{ return shortSwapIndexBase_; }

◆ swapIndexBase() [2/2]

string & swapIndexBase ( )

Definition at line 160 of file genericyieldvolcurveconfig.hpp.

160{ return swapIndexBase_; }

◆ smileOptionTenors() [2/2]

vector< string > & smileOptionTenors ( )

Definition at line 161 of file genericyieldvolcurveconfig.hpp.

161{ return smileOptionTenors_; }

◆ smileUnderlyingTenors() [2/2]

vector< string > & smileUnderlyingTenors ( )

Definition at line 162 of file genericyieldvolcurveconfig.hpp.

162{ return smileUnderlyingTenors_; }

◆ smileSpreads() [2/2]

vector< string > & smileSpreads ( )

Definition at line 163 of file genericyieldvolcurveconfig.hpp.

163{ return smileSpreads_; }

◆ quoteTag() [2/2]

string & quoteTag ( )

Definition at line 164 of file genericyieldvolcurveconfig.hpp.

164{ return quoteTag_; }

◆ populateRequiredCurveIds()

void populateRequiredCurveIds ( )
private

Definition at line 96 of file genericyieldvolcurveconfig.cpp.

96 {
97 if (!proxySourceCurveId_.empty()) {
99 parseCurveSpec(proxySourceCurveId_)->curveConfigID());
100 }
101}
map< CurveSpec::CurveType, set< string > > requiredCurveIds_
Definition: curveconfig.hpp:75
QuantLib::ext::shared_ptr< CurveSpec > parseCurveSpec(const string &s)
function to convert a string into a curve spec
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ccyFromSwapIndexBase()

string ccyFromSwapIndexBase ( const std::string &  swapIndexBase)
private

Definition at line 146 of file genericyieldvolcurveconfig.cpp.

146 {
147 std::vector<string> tokens;
148 split(tokens, swapIndexBase, boost::is_any_of("-"));
149 QL_REQUIRE(!tokens.empty() && tokens[0] != "",
150 "GenericYieldVolatilityCurveConfig::fromXML(): can not derive qualifier from SwapIndexBase ("
151 << swapIndexBase << ")");
152 return tokens[0];
153}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ underlyingLabel_

const string underlyingLabel_
private

Definition at line 171 of file genericyieldvolcurveconfig.hpp.

◆ rootNodeLabel_

const string rootNodeLabel_
private

Definition at line 171 of file genericyieldvolcurveconfig.hpp.

◆ marketDatumInstrumentLabel_

const string marketDatumInstrumentLabel_
private

Definition at line 171 of file genericyieldvolcurveconfig.hpp.

◆ qualifierLabel_

const string qualifierLabel_
private

Definition at line 171 of file genericyieldvolcurveconfig.hpp.

◆ allowSmile_

const bool allowSmile_
private

Definition at line 172 of file genericyieldvolcurveconfig.hpp.

◆ requireSwapIndexBases_

const bool requireSwapIndexBases_
private

Definition at line 172 of file genericyieldvolcurveconfig.hpp.

◆ qualifier_

string qualifier_
private

Definition at line 174 of file genericyieldvolcurveconfig.hpp.

◆ dimension_

Dimension dimension_ = Dimension::Smile
private

Definition at line 175 of file genericyieldvolcurveconfig.hpp.

◆ volatilityType_

VolatilityType volatilityType_ = VolatilityType::Normal
private

Definition at line 176 of file genericyieldvolcurveconfig.hpp.

◆ outputVolatilityType_

VolatilityType outputVolatilityType_ = VolatilityType::Normal
private

Definition at line 177 of file genericyieldvolcurveconfig.hpp.

◆ interpolation_

Interpolation interpolation_ = Interpolation::Linear
private

Definition at line 178 of file genericyieldvolcurveconfig.hpp.

◆ extrapolation_

Extrapolation extrapolation_ = Extrapolation::Flat
private

Definition at line 179 of file genericyieldvolcurveconfig.hpp.

◆ optionTenors_

vector<string> optionTenors_
private

Definition at line 180 of file genericyieldvolcurveconfig.hpp.

◆ underlyingTenors_

vector<string> underlyingTenors_
private

Definition at line 180 of file genericyieldvolcurveconfig.hpp.

◆ dayCounter_

DayCounter dayCounter_
private

Definition at line 181 of file genericyieldvolcurveconfig.hpp.

◆ calendar_

Calendar calendar_
private

Definition at line 182 of file genericyieldvolcurveconfig.hpp.

◆ businessDayConvention_

BusinessDayConvention businessDayConvention_
private

Definition at line 183 of file genericyieldvolcurveconfig.hpp.

◆ shortSwapIndexBase_

string shortSwapIndexBase_
private

Definition at line 184 of file genericyieldvolcurveconfig.hpp.

◆ swapIndexBase_

string swapIndexBase_
private

Definition at line 184 of file genericyieldvolcurveconfig.hpp.

◆ smileOptionTenors_

vector<string> smileOptionTenors_
private

Definition at line 185 of file genericyieldvolcurveconfig.hpp.

◆ smileUnderlyingTenors_

vector<string> smileUnderlyingTenors_
private

Definition at line 186 of file genericyieldvolcurveconfig.hpp.

◆ smileSpreads_

vector<string> smileSpreads_
private

Definition at line 187 of file genericyieldvolcurveconfig.hpp.

◆ quoteTag_

string quoteTag_
private

Definition at line 188 of file genericyieldvolcurveconfig.hpp.

◆ proxySourceCurveId_

string proxySourceCurveId_
private

Definition at line 190 of file genericyieldvolcurveconfig.hpp.

◆ proxySourceShortSwapIndexBase_

string proxySourceShortSwapIndexBase_
private

Definition at line 191 of file genericyieldvolcurveconfig.hpp.

◆ proxySourceSwapIndexBase_

string proxySourceSwapIndexBase_
private

Definition at line 192 of file genericyieldvolcurveconfig.hpp.

◆ proxyTargetShortSwapIndexBase_

string proxyTargetShortSwapIndexBase_
private

Definition at line 193 of file genericyieldvolcurveconfig.hpp.

◆ proxyTargetSwapIndexBase_

string proxyTargetSwapIndexBase_
private

Definition at line 194 of file genericyieldvolcurveconfig.hpp.

◆ parametricSmileConfiguration_

boost::optional<ParametricSmileConfiguration> parametricSmileConfiguration_
private

Definition at line 196 of file genericyieldvolcurveconfig.hpp.

◆ reportConfig_

ReportConfig reportConfig_
private

Definition at line 198 of file genericyieldvolcurveconfig.hpp.