Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Files | Classes | Functions

Files

file  basecorrelationcurve.hpp
 Wrapper class for building base correlation structures.
 
file  capfloorvolcurve.hpp
 Build optionlet volatility structures from cap floor configurations.
 
file  cdsvolcurve.hpp
 Class for building cds volatility structures.
 
file  commoditycurve.hpp
 Class for building a commodity price curve.
 
file  commodityvolcurve.hpp
 Wrapper class for building commodity volatility structures.
 
file  swaptionvolcurve.hpp
 Wrapper class for building Swaption volatility structures.
 
file  curvespec.hpp
 Curve requirements specification.
 
file  curvespecparser.hpp
 CurveSpec parser.
 
file  defaultcurve.hpp
 Wrapper class for building Default curves.
 
file  dummymarket.hpp
 Dummy Market class returning empty handles, used in tests.
 
file  equitycurve.hpp
 Wrapper class for building Equity curves.
 
file  equityvolcurve.hpp
 Wrapper class for building Equity volatility structures.
 
file  fxvolcurve.hpp
 Wrapper class for building FX volatility structures.
 
file  swaptionvolcurve.hpp
 Wrapper class for building Swaption volatility structures.
 
file  inflationcapfloorvolcurve.hpp
 Wrapper class for building YoY Inflation CapFloor volatility structures.
 
file  inflationcurve.hpp
 inflation curve class
 
file  swaptionvolcurve.hpp
 Wrapper class for building Swaption volatility structures.
 
file  yieldcurve.hpp
 Wrapper class for QuantLib term structures.
 
file  yieldvolcurve.hpp
 Wrapper class for building yield volatility structures.
 

Classes

class  BaseCorrelationCurve
 
class  CapFloorVolCurve
 
class  CDSVolCurve
 
class  CommodityVolCurve
 Wrapper class for building commodity volatility structures. More...
 
class  CorrelationCurve
 Wrapper class for building correlation structures. More...
 
class  CurveSpec
 Curve Specification. More...
 
class  YieldCurveSpec
 Yield curve description. More...
 
class  DefaultCurveSpec
 Default curve description. More...
 
class  CDSVolatilityCurveSpec
 CDS Volatility curve description. More...
 
class  BaseCorrelationCurveSpec
 Base Correlation surface description. More...
 
class  SwaptionVolatilityCurveSpec
 Swaption Volatility curve description. More...
 
class  YieldVolatilityCurveSpec
 Yield volatility curve description. More...
 
class  FXSpotSpec
 FX Spot description. More...
 
class  FXVolatilityCurveSpec
 FX Volatility curve description. More...
 
class  InflationCurveSpec
 Inflation curve description. More...
 
class  InflationCapFloorVolatilityCurveSpec
 Inflation cap floor volatility description. More...
 
class  EquityCurveSpec
 Equity curve description. More...
 
class  EquityVolatilityCurveSpec
 Equity Volatility curve description. More...
 
class  CommodityCurveSpec
 Commodity curve description. More...
 
class  CommodityVolatilityCurveSpec
 Commodity volatility description. More...
 
class  CorrelationCurveSpec
 Correlation curve description. More...
 
class  DefaultCurve
 Wrapper class for building Swaption volatility structures. More...
 
class  EquityCurve
 Wrapper class for building Equity curves (spot quote, yield term structure, risk free IR term structure) More...
 
class  EquityVolCurve
 Wrapper class for building Equity volatility structures. More...
 
class  FXVolCurve
 Wrapper class for building FX volatility structures. More...
 
class  GenericYieldVolCurve
 Wrapper class for building Generic yield volatility structures. More...
 
class  InflationCapFloorVolCurve
 
class  InflationCurve
 Wrapper class for building inflation curves. More...
 
class  SwaptionVolCurve
 Wrapper class for building Swaption volatility structures. More...
 
class  TodaysMarketParameters
 Today's Market Parameters. More...
 
class  YieldCurve
 Wrapper class for building yield term structures. More...
 
class  YieldVolCurve
 Wrapper class for building Yield volatility structures. More...
 

Functions

QuantLib::ext::shared_ptr< CurveSpecparseCurveSpec (const string &s)
 function to convert a string into a curve spec More...
 
CurveSpec::CurveType parseCurveConfigurationType (const std::string &)
 function to convert a curve configuration node string into a curve spec type More...
 

Detailed Description

Grouping of all curve related classes, functions and files

Function Documentation

◆ parseCurveSpec()

QuantLib::ext::shared_ptr< CurveSpec > parseCurveSpec ( const string &  s)

function to convert a string into a curve spec

Definition at line 64 of file curvespecparser.cpp.

64 {
65
66
67 boost::escaped_list_separator<char> sep('\\', '/', '\"');
68 boost::tokenizer<boost::escaped_list_separator<char> > tokenSplit(s, sep);
69
70 vector<string> tokens(tokenSplit.begin(), tokenSplit.end());
71
72 QL_REQUIRE(tokens.size() > 1, "number of tokens too small in curve spec " << s);
73
74 CurveSpec::CurveType curveType = parseCurveSpecType(tokens[0]);
75
76 switch (curveType) {
77
78 case CurveSpec::CurveType::Yield: {
79 // Expected format: Yield/CCY/CurveConfigID
80 // Example: Yield/EUR/eur-6M-curve
81 QL_REQUIRE(tokens.size() == 3, "Unexpected number"
82 " of tokens in yield curve spec "
83 << s);
84 const string& ccy = tokens[1];
85 const string& curveConfigID = tokens[2];
86 return QuantLib::ext::make_shared<YieldCurveSpec>(ccy, curveConfigID);
87 }
88
89 case CurveSpec::CurveType::Default: {
90 // Default/USD/CurveConfigID
91 QL_REQUIRE(tokens.size() == 3, "Unexpected number"
92 " of tokens in default curve spec "
93 << s);
94 const string& ccy = tokens[1];
95 const string& curveConfigID = tokens[2];
96 return QuantLib::ext::make_shared<DefaultCurveSpec>(ccy, curveConfigID);
97 }
98
99 case CurveSpec::CurveType::CDSVolatility: {
100 // CDSVolatility/CurveConfigID
101 QL_REQUIRE(tokens.size() == 2, "Unexpected number"
102 " of tokens in cds vol spec "
103 << s);
104 const string& curveConfigID = tokens[1];
105 return QuantLib::ext::make_shared<CDSVolatilityCurveSpec>(curveConfigID);
106 }
107
108 case CurveSpec::CurveType::BaseCorrelation: {
109 // BaseCorrelation/CurveConfigID
110 QL_REQUIRE(tokens.size() == 2, "Unexpected number"
111 " of tokens in cds vol spec "
112 << s);
113 const string& curveConfigID = tokens[1];
114 return QuantLib::ext::make_shared<BaseCorrelationCurveSpec>(curveConfigID);
115 }
116
117 case CurveSpec::CurveType::FX: {
118 // FX/USD/CHF
119 QL_REQUIRE(tokens.size() == 3, "Unexpected number"
120 " of tokens in FX curve spec "
121 << s);
122 const string& unitCcy = tokens[1];
123 const string& ccy = tokens[2];
124 return QuantLib::ext::make_shared<FXSpotSpec>(unitCcy, ccy);
125 }
126
127 case CurveSpec::CurveType::FXVolatility: {
128 // FX/USD/CHF/CurveConfigID
129 QL_REQUIRE(tokens.size() == 4, "Unexpected number"
130 " of tokens in fx vol curve spec "
131 << s);
132 const string& unitCcy = tokens[1];
133 const string& ccy = tokens[2];
134 const string& curveConfigID = tokens[3];
135 return QuantLib::ext::make_shared<FXVolatilityCurveSpec>(unitCcy, ccy, curveConfigID);
136 }
137
138 case CurveSpec::CurveType::SwaptionVolatility: {
139 // SwaptionVolatility/EUR/CurveConfigID
140 QL_REQUIRE(tokens.size() == 3, "Unexpected number"
141 " of tokens in swaption vol curve spec "
142 << s);
143 const string& key = tokens[1];
144 const string& curveConfigID = tokens[2];
145 return QuantLib::ext::make_shared<SwaptionVolatilityCurveSpec>(key, curveConfigID);
146 }
147
148 case CurveSpec::CurveType::YieldVolatility: {
149 // YieldVolatility/CurveConfigID
150 QL_REQUIRE(tokens.size() == 2, "Unexpected number"
151 " of tokens in yield vol curve spec "
152 << s);
153 const string& curveConfigID = tokens[1];
154 return QuantLib::ext::make_shared<YieldVolatilityCurveSpec>(curveConfigID);
155 }
156
157 case CurveSpec::CurveType::CapFloorVolatility: {
158 // e.g. CapFloorVolatility/EUR-EURIBOR-3M/CurveConfigID
159 // CapFloorVolatility/EUR-ESTER/CurveConfigID
160 // CapFloorVolatility/EUR/CurveConfigID
161 QL_REQUIRE(tokens.size() == 3, "Unexpected number"
162 " of tokens in CapFloor volatility curve spec "
163 << s);
164 const string& key = tokens[1];
165 const string& curveConfigID = tokens[2];
166 return QuantLib::ext::make_shared<CapFloorVolatilityCurveSpec>(key, curveConfigID);
167 }
168
169 case CurveSpec::CurveType::Inflation: {
170 // Inflation/EUHICPXT/CurveConfigID
171 QL_REQUIRE(tokens.size() == 3, "Unexpected number"
172 " of tokens in inflation curve spec "
173 << s);
174 const string& index = tokens[1];
175 const string& curveConfigID = tokens[2];
176 return QuantLib::ext::make_shared<InflationCurveSpec>(index, curveConfigID);
177 }
178
179 case CurveSpec::CurveType::InflationCapFloorVolatility: {
180 // e.g. InflationCapFloorVolatility/EUHICPXT/CurveConfigID
181 QL_REQUIRE(tokens.size() == 3, "Unexpected number"
182 " of tokens in InflationCapFloor volatility curve spec "
183 << s);
184 const string& index = tokens[1];
185 const string& curveConfigID = tokens[2];
186 return QuantLib::ext::make_shared<InflationCapFloorVolatilityCurveSpec>(index, curveConfigID);
187 }
188
189 case CurveSpec::CurveType::Equity: {
190 // Equity/USD/CurveConfigID
191 QL_REQUIRE(tokens.size() == 3, "Unexpected number"
192 " of tokens in default curve spec "
193 << s);
194 const string& ccy = tokens[1];
195 const string& curveConfigID = tokens[2];
196 return QuantLib::ext::make_shared<EquityCurveSpec>(ccy, curveConfigID);
197 }
198
199 case CurveSpec::CurveType::EquityVolatility: {
200 // EquityVolatility/USD/CurveConfigID
201 QL_REQUIRE(tokens.size() == 3, "Unexpected number"
202 " of tokens in default curve spec "
203 << s);
204 const string& ccy = tokens[1];
205 const string& curveConfigID = tokens[2];
206 return QuantLib::ext::make_shared<EquityVolatilityCurveSpec>(ccy, curveConfigID);
207 }
208
209 case CurveSpec::CurveType::Security: {
210 // Security/ISIN
211 QL_REQUIRE(tokens.size() == 2, "Unexpected number"
212 " of tokens in Security Spread spec "
213 << s);
214 const string& securityID = tokens[1];
215 return QuantLib::ext::make_shared<SecuritySpec>(securityID);
216 }
217
218 case CurveSpec::CurveType::Commodity: {
219 // Commodity/CCY/CommodityCurveConfigId
220 QL_REQUIRE(tokens.size() == 3, "Unexpected number of tokens in commodity curve spec " << s);
221 return QuantLib::ext::make_shared<CommodityCurveSpec>(tokens[1], tokens[2]);
222 }
223
224 case CurveSpec::CurveType::CommodityVolatility: {
225 // CommodityVolatility/CCY/CommodityVolatilityConfigId
226 QL_REQUIRE(tokens.size() == 3, "Unexpected number of tokens in commodity volatility spec " << s);
227 return QuantLib::ext::make_shared<CommodityVolatilityCurveSpec>(tokens[1], tokens[2]);
228 }
229
230 case CurveSpec::CurveType::Correlation: {
231 // Correlation/CorrelationCurveConfigId
232 QL_REQUIRE(tokens.size() == 2, "Unexpected number of tokens in correlation spec " << s);
233 string id = tokens[1];
234 return QuantLib::ext::make_shared<CorrelationCurveSpec>(id);
235 }
236
237 // TODO: the rest...
238 }
239
240 QL_FAIL("Unable to convert \"" << s << "\" into CurveSpec");
241}
+ Here is the caller graph for this function:

◆ parseCurveConfigurationType()

CurveSpec::CurveType parseCurveConfigurationType ( const std::string &  s)

function to convert a curve configuration node string into a curve spec type

Definition at line 244 of file curvespecparser.cpp.

244 {
245 static const map<string, CurveSpec::CurveType> b = {
246 {"YieldCurves", CurveSpec::CurveType::Yield},
247 {"CapFloorVolatilities", CurveSpec::CurveType::CapFloorVolatility},
248 {"SwaptionVolatilities", CurveSpec::CurveType::SwaptionVolatility},
249 {"YieldVolatilities", CurveSpec::CurveType::YieldVolatility},
250 {"FXSpots", CurveSpec::CurveType::FX},
251 {"FXVolatilities", CurveSpec::CurveType::FXVolatility},
252 {"DefaultCurves", CurveSpec::CurveType::Default},
253 {"CDSVolatilities", CurveSpec::CurveType::CDSVolatility},
254 {"BaseCorrelations", CurveSpec::CurveType::BaseCorrelation},
255 {"InflationCurves", CurveSpec::CurveType::Inflation},
256 {"InflationCapFloorVolatilities", CurveSpec::CurveType::InflationCapFloorVolatility},
257 {"EquityCurves", CurveSpec::CurveType::Equity},
258 {"EquityVolatilities", CurveSpec::CurveType::EquityVolatility},
259 {"Securities", CurveSpec::CurveType::Security},
260 {"CommodityCurves", CurveSpec::CurveType::Commodity},
261 {"Correlations", CurveSpec::CurveType::Correlation},
262 {"CommodityVolatilities", CurveSpec::CurveType::CommodityVolatility}};
263
264 auto it = b.find(s);
265 if (it != b.end()) {
266 return it->second;
267 } else {
268 QL_FAIL("Cannot convert \"" << s << "\" to CurveSpecType");
269 }
270}
+ Here is the caller graph for this function: