Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
volatilityconfig.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 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
22
23using std::make_pair;
24using std::pair;
25using std::string;
26using std::vector;
27
28namespace ore {
29namespace data {
30
31bool operator<(const VolatilityConfig& vc1, const VolatilityConfig& vc2) {
32 return vc1.priority() < vc2.priority();
33}
34
35VolatilityConfig::VolatilityConfig(string calendarStr, QuantLib::Natural priority)
36 : calendarStr_(calendarStr), priority_(priority) {
37 calendar_ = calendarStr_.empty() ? Calendar() : parseCalendar(calendarStr_);
38}
39
41 string attr = XMLUtils::getAttribute(node, "priority");
42 priority_ = attr.empty() ? 0 : parseInteger(attr);
43
44 calendarStr_ = XMLUtils::getChildValue(node, "Calendar", false);
45 calendar_ = calendarStr_.empty() ? Calendar() : parseCalendar(calendarStr_);
46}
47
49 XMLUtils::addAttribute(doc, node, "priority", std::to_string(priority_));
50 if (!calendarStr_.empty())
51 XMLUtils::addChild(doc, node, "Calendar", calendarStr_);
52}
53
55 XMLUtils::checkNode(node, "ProxySurface");
57 proxyVolatilityCurve_ = XMLUtils::getChildValue(node, "ProxyVolatilityCurve", false);
58 fxVolatilityCurve_ = XMLUtils::getChildValue(node, "FXVolatilityCurve", false);
59 correlationCurve_ = XMLUtils::getChildValue(node, "CorrelationCurve", false);
60}
61
63 XMLNode* node = doc.allocNode("ProxySurface");
65 XMLUtils::addChild(doc, node, "ProxyVolatilityCurve", proxyVolatilityCurve_);
66 if (!fxVolatilityCurve_.empty())
67 XMLUtils::addChild(doc, node, "FXVolatilityCurve", fxVolatilityCurve_);
68 if (!correlationCurve_.empty())
69 XMLUtils::addChild(doc, node, "CorrelationCurve", correlationCurve_);
70 return node;
71}
72
75}
76
77const std::string& ProxyVolatilityConfig::fxVolatilityCurve() const {
78 return fxVolatilityCurve_;
79}
80
81const std::string& ProxyVolatilityConfig::correlationCurve() const {
82 return correlationCurve_;
83}
84
86 XMLUtils::checkNode(node, "ProxySurface");
88 cdsVolatilityCurve_ = XMLUtils::getChildValue(node, "CDSVolatilityCurve", true);
89}
90
92 XMLNode* node = doc.allocNode("ProxySurface");
94 XMLUtils::addChild(doc, node, "CDSVolatilityCurve", cdsVolatilityCurve_);
95 return node;
96}
97
99
102 string qType = XMLUtils::getChildValue(node, "QuoteType", false);
103 if (qType == "ImpliedVolatility" || qType == "") {
104 string volType = XMLUtils::getChildValue(node, "VolatilityType", false);
105 if (volType == "Lognormal" || qType == "") {
107 } else if (volType == "ShiftedLognormal") {
109 } else if (volType == "Normal") {
111 } else {
112 QL_FAIL("Volatility type " << volType << " is not supported;");
113 }
114 } else if (qType == "Premium") {
116 // If we have premiums the exercise type is required
117 exerciseType_ = parseExerciseType(XMLUtils::getChildValue(node, "ExerciseType", true));
118 } else {
119 QL_FAIL("Invalid quote type for volatility curve , quote type must be ImpliedVolatility or Premium");
120 }
121}
122
125
126 // Check first for premium
128 XMLUtils::addChild(doc, node, "QuoteType", "Premium");
129 XMLUtils::addChild(doc, node, "ExerciseType", ore::data::to_string(exerciseType_));
130 return;
131 }
132
133 // Must be a volatility (or possibly fail)
134 XMLUtils::addChild(doc, node, "QuoteType", "ImpliedVolatility");
136 XMLUtils::addChild(doc, node, "VolatilityType", "Lognormal");
138 XMLUtils::addChild(doc, node, "VolatilityType", "ShiftedLognormal");
140 XMLUtils::addChild(doc, node, "VolatilityType", "Normal");
141 } else {
142 QL_FAIL("Invalid quote type");
143 }
144}
145
147 Exercise::Type exerciseType, string calendarStr, Natural priority)
148 : QuoteBasedVolatilityConfig(quoteType, exerciseType, calendarStr, priority) {}
149
151 Exercise::Type exerciseType, string calendarStr, Natural priority)
152 : QuoteBasedVolatilityConfig(quoteType, exerciseType, calendarStr, priority), quote_(quote) {}
153
154const string& ConstantVolatilityConfig::quote() const { return quote_; }
155
157 XMLUtils::checkNode(node, "Constant");
159 quote_ = XMLUtils::getChildValue(node, "Quote", true);
160}
161
163 XMLNode* node = doc.allocNode("Constant");
165 XMLUtils::addChild(doc, node, "Quote", quote_);
166 return node;
167}
168
169VolatilityCurveConfig::VolatilityCurveConfig(MarketDatum::QuoteType quoteType, Exercise::Type exerciseType,
170 bool enforceMontoneVariance, string calendarStr, Natural priority)
171 : QuoteBasedVolatilityConfig(quoteType, exerciseType, calendarStr, priority),
172 enforceMontoneVariance_(enforceMontoneVariance) {}
173
174VolatilityCurveConfig::VolatilityCurveConfig(const vector<string>& quotes, const string& interpolation,
175 const string& extrapolation, MarketDatum::QuoteType quoteType, Exercise::Type exerciseType,
176 bool enforceMontoneVariance, string calendarStr, Natural priority)
177 : QuoteBasedVolatilityConfig(quoteType, exerciseType, calendarStr, priority), quotes_(quotes),
178 interpolation_(interpolation),
179 extrapolation_(extrapolation), enforceMontoneVariance_(enforceMontoneVariance) {}
180
181const vector<string>& VolatilityCurveConfig::quotes() const { return quotes_; }
182
184
186
188
190 XMLUtils::checkNode(node, "Curve");
192 quotes_ = XMLUtils::getChildrenValues(node, "Quotes", "Quote", true);
193 interpolation_ = XMLUtils::getChildValue(node, "Interpolation", true);
194 extrapolation_ = XMLUtils::getChildValue(node, "Extrapolation", true);
195
197 if (XMLNode* n = XMLUtils::getChildNode(node, "EnforceMontoneVariance"))
199}
200
202 XMLNode* node = doc.allocNode("Curve");
204 XMLUtils::addChildren(doc, node, "Quotes", "Quote", quotes_);
205 XMLUtils::addChild(doc, node, "Interpolation", interpolation_);
206 XMLUtils::addChild(doc, node, "Extrapolation", extrapolation_);
207 XMLUtils::addChild(doc, node, "EnforceMontoneVariance", enforceMontoneVariance_);
208 return node;
209}
210
212 Exercise::Type exerciseType, string calendarStr, Natural priority)
213 : QuoteBasedVolatilityConfig(quoteType, exerciseType, calendarStr, priority) {}
214
215VolatilitySurfaceConfig::VolatilitySurfaceConfig(const string& timeInterpolation, const string& strikeInterpolation,
216 bool extrapolation, const string& timeExtrapolation,
217 const string& strikeExtrapolation, MarketDatum::QuoteType quoteType,
218 Exercise::Type exerciseType, string calendarStr, Natural priority)
219 : QuoteBasedVolatilityConfig(quoteType, exerciseType, calendarStr, priority), timeInterpolation_(timeInterpolation),
220 strikeInterpolation_(strikeInterpolation), extrapolation_(extrapolation), timeExtrapolation_(timeExtrapolation),
221 strikeExtrapolation_(strikeExtrapolation) {}
222
224
226
228
230
232
234 timeInterpolation_ = XMLUtils::getChildValue(node, "TimeInterpolation", true);
235 strikeInterpolation_ = XMLUtils::getChildValue(node, "StrikeInterpolation", true);
236 extrapolation_ = parseBool(XMLUtils::getChildValue(node, "Extrapolation", true));
237 timeExtrapolation_ = XMLUtils::getChildValue(node, "TimeExtrapolation", true);
238 strikeExtrapolation_ = XMLUtils::getChildValue(node, "StrikeExtrapolation", true);
239}
240
242 XMLUtils::addChild(doc, node, "TimeInterpolation", timeInterpolation_);
243 XMLUtils::addChild(doc, node, "StrikeInterpolation", strikeInterpolation_);
244 XMLUtils::addChild(doc, node, "Extrapolation", extrapolation_);
245 XMLUtils::addChild(doc, node, "TimeExtrapolation", timeExtrapolation_);
246 XMLUtils::addChild(doc, node, "StrikeExtrapolation", strikeExtrapolation_);
247}
248
250 Exercise::Type exerciseType, string calendarStr, Natural priority)
251 : VolatilitySurfaceConfig(quoteType, exerciseType, calendarStr, priority) {}
252
254 const vector<string>& strikes, const vector<string>& expiries, const string& timeInterpolation,
255 const string& strikeInterpolation, bool extrapolation, const string& timeExtrapolation,
256 const string& strikeExtrapolation, MarketDatum::QuoteType quoteType, Exercise::Type exerciseType,
257 string calendarStr, Natural priority)
258 : VolatilitySurfaceConfig(timeInterpolation, strikeInterpolation, extrapolation, timeExtrapolation,
259 strikeExtrapolation, quoteType, exerciseType, calendarStr, priority),
260 strikes_(strikes), expiries_(expiries) {}
261
262const vector<string>& VolatilityStrikeSurfaceConfig::strikes() const { return strikes_; }
263
264const vector<string>& VolatilityStrikeSurfaceConfig::expiries() const { return expiries_; }
265
266vector<pair<string, string>> VolatilityStrikeSurfaceConfig::quotes() const {
267
268 vector<pair<string, string>> result;
269
270 for (const string& e : expiries()) {
271 for (const string& s : strikes_) {
272 result.push_back(make_pair(e, s));
273 }
274 }
275
276 return result;
277}
278
280 XMLUtils::checkNode(node, "StrikeSurface");
282 strikes_ = XMLUtils::getChildrenValuesAsStrings(node, "Strikes", true);
283 expiries_ = XMLUtils::getChildrenValuesAsStrings(node, "Expiries", true);
284 fromNode(node);
285}
286
288 XMLNode* node = doc.allocNode("StrikeSurface");
290 XMLUtils::addGenericChildAsList(doc, node, "Strikes", strikes_);
291 XMLUtils::addGenericChildAsList(doc, node, "Expiries", expiries_);
292 addNodes(doc, node);
293 return node;
294}
295
297 Exercise::Type exerciseType, string calendarStr, Natural priority)
298 : VolatilitySurfaceConfig(quoteType, exerciseType, calendarStr, priority) {}
299
301 const string& deltaType, const string& atmType, const vector<string>& putDeltas, const vector<string>& callDeltas,
302 const vector<string>& expiries, const string& timeInterpolation, const string& strikeInterpolation,
303 bool extrapolation, const string& timeExtrapolation, const string& strikeExtrapolation,
304 const std::string& atmDeltaType, bool futurePriceCorrection, MarketDatum::QuoteType quoteType,
305 Exercise::Type exerciseType, string calendarStr, Natural priority)
306 : VolatilitySurfaceConfig(timeInterpolation, strikeInterpolation, extrapolation, timeExtrapolation,
307 strikeExtrapolation, quoteType, exerciseType, calendarStr, priority),
308 deltaType_(deltaType), atmType_(atmType), putDeltas_(putDeltas), callDeltas_(callDeltas), expiries_(expiries),
309 atmDeltaType_(atmDeltaType), futurePriceCorrection_(futurePriceCorrection) {}
310
312
313const string& VolatilityDeltaSurfaceConfig::atmType() const { return atmType_; }
314
315const vector<string>& VolatilityDeltaSurfaceConfig::putDeltas() const { return putDeltas_; }
316
317const vector<string>& VolatilityDeltaSurfaceConfig::callDeltas() const { return callDeltas_; }
318
319const vector<string>& VolatilityDeltaSurfaceConfig::expiries() const { return expiries_; }
320
322
324
325vector<pair<string, string>> VolatilityDeltaSurfaceConfig::quotes() const {
326
327 vector<pair<string, string>> result;
328
329 // ATM strike string
330 string atmString = "ATM/" + atmType_;
331 if (!atmDeltaType_.empty())
332 atmString += "/DEL/" + atmDeltaType_;
333
334 // Delta stem
335 string stem = "DEL/" + deltaType_ + "/";
336
337 for (const string& e : expiries()) {
338 result.push_back(make_pair(e, atmString));
339 for (const string& d : putDeltas_) {
340 result.push_back(make_pair(e, stem + "Put/" + d));
341 }
342 for (const string& d : callDeltas_) {
343 result.push_back(make_pair(e, stem + "Call/" + d));
344 }
345 }
346
347 return result;
348}
349
351 XMLUtils::checkNode(node, "DeltaSurface");
353 deltaType_ = XMLUtils::getChildValue(node, "DeltaType", true);
354 atmType_ = XMLUtils::getChildValue(node, "AtmType", true);
355 atmDeltaType_ = XMLUtils::getChildValue(node, "AtmDeltaType", false);
356 putDeltas_ = XMLUtils::getChildrenValuesAsStrings(node, "PutDeltas", true);
357 callDeltas_ = XMLUtils::getChildrenValuesAsStrings(node, "CallDeltas", true);
358 expiries_ = XMLUtils::getChildrenValuesAsStrings(node, "Expiries", true);
360 if (XMLNode* n = XMLUtils::getChildNode(node, "FuturePriceCorrection"))
362 fromNode(node);
363}
364
366 XMLNode* node = doc.allocNode("DeltaSurface");
368 XMLUtils::addChild(doc, node, "DeltaType", deltaType_);
369 XMLUtils::addChild(doc, node, "AtmType", atmType_);
370 if (!atmDeltaType_.empty())
371 XMLUtils::addChild(doc, node, "AtmDeltaType", atmDeltaType_);
372 XMLUtils::addGenericChildAsList(doc, node, "PutDeltas", putDeltas_);
373 XMLUtils::addGenericChildAsList(doc, node, "CallDeltas", callDeltas_);
374 XMLUtils::addGenericChildAsList(doc, node, "Expiries", expiries_);
375 addNodes(doc, node);
376 XMLUtils::addChild(doc, node, "FuturePriceCorrection", futurePriceCorrection_);
377
378 return node;
379}
380
382 Exercise::Type exerciseType, string calendarStr, Natural priority)
383 : VolatilitySurfaceConfig(quoteType, exerciseType, calendarStr, priority) {}
384
386 const string& moneynessType, const vector<string>& moneynessLevels, const vector<string>& expiries,
387 const string& timeInterpolation, const string& strikeInterpolation, bool extrapolation,
388 const string& timeExtrapolation, const string& strikeExtrapolation, bool futurePriceCorrection,
389 MarketDatum::QuoteType quoteType, Exercise::Type exerciseType, string calendarStr, Natural priority)
390 : VolatilitySurfaceConfig(timeInterpolation, strikeInterpolation, extrapolation, timeExtrapolation,
391 strikeExtrapolation, quoteType, exerciseType, calendarStr, priority),
392 moneynessType_(moneynessType), moneynessLevels_(moneynessLevels), expiries_(expiries),
393 futurePriceCorrection_(futurePriceCorrection) {}
394
396
398
399const vector<string>& VolatilityMoneynessSurfaceConfig::expiries() const { return expiries_; }
400
402
403vector<pair<string, string>> VolatilityMoneynessSurfaceConfig::quotes() const {
404
405 vector<pair<string, string>> result;
406
407 // Moneyness stem
408 string stem = "MNY/" + moneynessType_ + "/";
409
410 for (const string& e : expiries()) {
411 for (const string& m : moneynessLevels_) {
412 result.push_back(make_pair(e, stem + m));
413 }
414 }
415
416 return result;
417}
418
420 XMLUtils::checkNode(node, "MoneynessSurface");
422 moneynessType_ = XMLUtils::getChildValue(node, "MoneynessType", true);
423 moneynessLevels_ = XMLUtils::getChildrenValuesAsStrings(node, "MoneynessLevels", true);
424 expiries_ = XMLUtils::getChildrenValuesAsStrings(node, "Expiries", true);
426 if (XMLNode* n = XMLUtils::getChildNode(node, "FuturePriceCorrection"))
428 fromNode(node);
429}
430
432 XMLNode* node = doc.allocNode("MoneynessSurface");
434 XMLUtils::addChild(doc, node, "MoneynessType", moneynessType_);
435 XMLUtils::addGenericChildAsList(doc, node, "MoneynessLevels", moneynessLevels_);
436 XMLUtils::addGenericChildAsList(doc, node, "Expiries", expiries_);
437 addNodes(doc, node);
438 XMLUtils::addChild(doc, node, "FuturePriceCorrection", futurePriceCorrection_);
439
440 return node;
441}
442
444 Exercise::Type exerciseType, string calendarStr, Natural priority)
445 : VolatilitySurfaceConfig(quoteType, exerciseType, calendarStr, priority) {}
446
448 const std::vector<std::string>& moneynessLevels, const std::string& baseVolatilityId,
449 const std::string& basePriceCurveId, const std::string& baseConventionsId, const std::string& timeInterpolation,
450 const std::string& strikeInterpolation, bool extrapolation, const std::string& timeExtrapolation,
451 const std::string& strikeExtrapolation, Real beta, const std::string& maxTenor, MarketDatum::QuoteType quoteType,
452 Exercise::Type exerciseType, string calendarStr, Natural priority)
453 : VolatilitySurfaceConfig(timeInterpolation, strikeInterpolation, extrapolation, timeExtrapolation,
454 strikeExtrapolation, quoteType, exerciseType, calendarStr, priority),
455 moneynessLevels_(moneynessLevels), baseVolatilityId_(baseVolatilityId), basePriceCurveId_(basePriceCurveId),
456 baseConventionsId_(baseConventionsId), beta_(beta), maxTenor_(maxTenor) {}
457
459
461
463
465
467
469
470vector<pair<string, string>> VolatilityApoFutureSurfaceConfig::quotes() const { return vector<pair<string, string>>(); }
471
473 XMLUtils::checkNode(node, "ApoFutureSurface");
475 moneynessLevels_ = XMLUtils::getChildrenValuesAsStrings(node, "MoneynessLevels", true);
476 baseVolatilityId_ = XMLUtils::getChildValue(node, "VolatilityId", true);
477 basePriceCurveId_ = XMLUtils::getChildValue(node, "PriceCurveId", true);
478 baseConventionsId_ = XMLUtils::getChildValue(node, "FutureConventions", true);
479 maxTenor_ = XMLUtils::getChildValue(node, "MaxTenor", false);
480 beta_ = XMLUtils::getChildValueAsDouble(node, "Beta", false);
481 fromNode(node);
482}
483
485 XMLNode* node = doc.allocNode("ApoFutureSurface");
487 XMLUtils::addGenericChildAsList(doc, node, "MoneynessLevels", moneynessLevels_);
488 XMLUtils::addChild(doc, node, "VolatilityId", baseVolatilityId_);
489 XMLUtils::addChild(doc, node, "PriceCurveId", basePriceCurveId_);
490 XMLUtils::addChild(doc, node, "FutureConventions", baseConventionsId_);
491 addNodes(doc, node);
492 if (!maxTenor_.empty())
493 XMLUtils::addChild(doc, node, "MaxTenor", maxTenor_);
494 XMLUtils::addChild(doc, node, "Beta", beta_);
495
496 return node;
497}
498
500 for (XMLNode* n = XMLUtils::getChildNode(node, "Constant"); n; n = XMLUtils::getNextSibling(n, "Constant")) {
501 auto vc = QuantLib::ext::make_shared<ConstantVolatilityConfig>();
502 vc->fromXML(n);
503 volatilityConfig_.push_back(vc);
504 }
505
506 for (XMLNode* n = XMLUtils::getChildNode(node, "Curve"); n; n = XMLUtils::getNextSibling(n, "Curve")) {
507 auto vc = QuantLib::ext::make_shared<VolatilityCurveConfig>();
508 vc->fromXML(n);
509 volatilityConfig_.push_back(vc);
510 }
511
512 for (XMLNode* n = XMLUtils::getChildNode(node, "DeltaSurface"); n;
513 n = XMLUtils::getNextSibling(n, "DeltaSurface")) {
514 auto vc = QuantLib::ext::make_shared<VolatilityDeltaSurfaceConfig>();
515 vc->fromXML(n);
516 volatilityConfig_.push_back(vc);
517 }
518
519 for (XMLNode* n = XMLUtils::getChildNode(node, "StrikeSurface"); n;
520 n = XMLUtils::getNextSibling(n, "StrikeSurface")) {
521 auto vc = QuantLib::ext::make_shared<VolatilityStrikeSurfaceConfig>();
522 vc->fromXML(n);
523 volatilityConfig_.push_back(vc);
524 }
525
526 for (XMLNode* n = XMLUtils::getChildNode(node, "MoneynessSurface"); n;
527 n = XMLUtils::getNextSibling(n, "MoneynessSurface")) {
528 auto vc = QuantLib::ext::make_shared<VolatilityMoneynessSurfaceConfig>();
529 vc->fromXML(n);
530 volatilityConfig_.push_back(vc);
531 }
532
533 for (XMLNode* n = XMLUtils::getChildNode(node, "ApoFutureSurface"); n;
534 n = XMLUtils::getNextSibling(n, "ApoFutureSurface")) {
535 auto vc = QuantLib::ext::make_shared<VolatilityApoFutureSurfaceConfig>();
536 vc->fromXML(n);
537 volatilityConfig_.push_back(vc);
538 }
539
540 for (XMLNode* n = XMLUtils::getChildNode(node, "ProxySurface"); n;
541 n = XMLUtils::getNextSibling(n, "ProxySurface")) {
542 auto vc = QuantLib::ext::make_shared<ProxyVolatilityConfig>();
543 vc->fromXML(n);
544 volatilityConfig_.push_back(vc);
545 }
546
547 QL_REQUIRE(volatilityConfig_.size() > 0,
548 "VolatilityConfigBuilder expects at least one child node of type: "
549 "Constant, Curve, StrikeSurface, DeltaSurface, MoneynessSurface, ApoFutureSurface, ProxySurface.");
550
551 // sort the volatility configs by priority
552 if (volatilityConfig_.size() > 1)
553 std::sort(volatilityConfig_.begin(), volatilityConfig_.end(),
554 [](const QuantLib::ext::shared_ptr<VolatilityConfig>& a, const QuantLib::ext::shared_ptr<VolatilityConfig>& b) {
555 QL_REQUIRE(a && b,
556 "VolatilityConfigBuilder fails to sort the configs, can not compare a nullptr");
557 return *a < *b;
558 });
559}
560
562 if (XMLNode* n = XMLUtils::getChildNode(node, "VolatilityConfig"))
564 else
566}
567
569
570} // namespace data
571} // namespace ore
void fromXML(ore::data::XMLNode *node) override
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
const std::string & cdsVolatilityCurve() const
void fromXML(ore::data::XMLNode *node) override
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
ConstantVolatilityConfig(MarketDatum::QuoteType quoteType=MarketDatum::QuoteType::RATE_LNVOL, QuantLib::Exercise::Type exerciseType=QuantLib::Exercise::Type::European, std::string calendarStr=std::string(), QuantLib::Natural priority=0)
Default constructor.
const std::string & quote() const
QuoteType
Supported market quote types.
const std::string & correlationCurve() const
const std::string & fxVolatilityCurve() const
void fromXML(ore::data::XMLNode *node) override
const std::string & proxyVolatilityCurve() const
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
void fromBaseNode(ore::data::XMLNode *node)
void toBaseNode(ore::data::XMLDocument &doc, ore::data::XMLNode *node) const
std::vector< std::pair< std::string, std::string > > quotes() const override
void fromXML(ore::data::XMLNode *node) override
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
VolatilityApoFutureSurfaceConfig(MarketDatum::QuoteType quoteType=MarketDatum::QuoteType::RATE_LNVOL, QuantLib::Exercise::Type exerciseType=QuantLib::Exercise::Type::European, std::string calendarStr=std::string(), QuantLib::Natural priority=0)
Default constructor.
const std::vector< std::string > & moneynessLevels() const
void fromXML(XMLNode *node) override
std::vector< QuantLib::ext::shared_ptr< VolatilityConfig > > volatilityConfig_
XMLNode * toXML(ore::data::XMLDocument &doc) const override
QuantLib::Natural priority() const
void fromXMLNode(ore::data::XMLNode *node)
VolatilityConfig(std::string calendarStr=std::string(), QuantLib::Natural priority=0)
void toXMLNode(XMLDocument &doc, XMLNode *node) const
const std::string & interpolation() const
void fromXML(ore::data::XMLNode *node) override
std::vector< std::string > quotes_
const std::string & extrapolation() const
VolatilityCurveConfig(MarketDatum::QuoteType quoteType=MarketDatum::QuoteType::RATE_LNVOL, QuantLib::Exercise::Type exerciseType=QuantLib::Exercise::Type::European, bool enforceMontoneVariance=true, std::string calendarStr=std::string(), QuantLib::Natural priority=0)
Default constructor.
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
const std::vector< std::string > & quotes() const
std::vector< std::pair< std::string, std::string > > quotes() const override
const std::vector< std::string > & putDeltas() const
const std::vector< std::string > & callDeltas() const
void fromXML(ore::data::XMLNode *node) override
const std::vector< std::string > & expiries() const
const std::string & atmDeltaType() const
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
VolatilityDeltaSurfaceConfig(MarketDatum::QuoteType quoteType=MarketDatum::QuoteType::RATE_LNVOL, QuantLib::Exercise::Type exerciseType=QuantLib::Exercise::Type::European, std::string calendarStr=std::string(), QuantLib::Natural priority=0)
Default constructor.
std::vector< std::pair< std::string, std::string > > quotes() const override
VolatilityMoneynessSurfaceConfig(MarketDatum::QuoteType quoteType=MarketDatum::QuoteType::RATE_LNVOL, QuantLib::Exercise::Type exerciseType=QuantLib::Exercise::Type::European, std::string calendarStr=std::string(), QuantLib::Natural priority=0)
Default constructor.
void fromXML(ore::data::XMLNode *node) override
const std::vector< std::string > & expiries() const
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
const std::vector< std::string > & moneynessLevels() const
std::vector< std::pair< std::string, std::string > > quotes() const override
void fromXML(ore::data::XMLNode *node) override
const std::vector< std::string > & expiries() const
const std::vector< std::string > & strikes() const
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
VolatilityStrikeSurfaceConfig(MarketDatum::QuoteType quoteType=MarketDatum::QuoteType::RATE_LNVOL, QuantLib::Exercise::Type exerciseType=QuantLib::Exercise::Type::European, std::string calendarStr=std::string(), QuantLib::Natural priority=0)
Default constructor.
const std::string & timeInterpolation() const
void addNodes(ore::data::XMLDocument &doc, ore::data::XMLNode *node) const
VolatilitySurfaceConfig(MarketDatum::QuoteType quoteType=MarketDatum::QuoteType::RATE_LNVOL, QuantLib::Exercise::Type exerciseType=QuantLib::Exercise::Type::European, std::string calendarStr=std::string(), QuantLib::Natural priority=0)
Default constructor.
const std::string & strikeInterpolation() const
const std::string & strikeExtrapolation() const
void fromNode(ore::data::XMLNode *node)
const std::string & timeExtrapolation() const
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
static void addAttribute(XMLDocument &doc, XMLNode *node, const string &attrName, const string &attrValue)
Definition: xmlutils.cpp:412
static void addChildren(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values)
Definition: xmlutils.cpp:502
static string getAttribute(XMLNode *node, const string &attrName)
Definition: xmlutils.cpp:419
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 void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static Real getChildValueAsDouble(XMLNode *node, const string &name, bool mandatory=false, double defaultValue=0.0)
Definition: xmlutils.cpp:286
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 string getNodeValue(XMLNode *node)
Get a node's value.
Definition: xmlutils.cpp:489
static XMLNode * getNextSibling(XMLNode *node, const string &name="")
Get a node's next sibling node.
Definition: xmlutils.cpp:484
static vector< string > getChildrenValuesAsStrings(XMLNode *node, const string &name, bool mandatory=false)
Definition: xmlutils.cpp:342
static vector< string > getChildrenValues(XMLNode *node, const string &names, const string &name, bool mandatory=false)
Definition: xmlutils.cpp:306
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
Definition: parsers.cpp:157
Exercise::Type parseExerciseType(const std::string &s)
Convert text to QuantLib::Exercise::Type.
Definition: parsers.cpp:466
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
Definition: parsers.cpp:136
@ data
Definition: log.hpp:77
bool operator<(const Dividend &d1, const Dividend &d2)
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
Serializable Credit Default Swap.
Definition: namespaces.docs:23
Map text representations to QuantLib/QuantExt types.
SimpleQuote & quote_
vector< Real > strikes
string conversion utilities