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

#include <ored/configuration/volatilityconfig.hpp>

+ Inheritance diagram for VolatilityDeltaSurfaceConfig:
+ Collaboration diagram for VolatilityDeltaSurfaceConfig:

Public Member Functions

 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. More...
 
 VolatilityDeltaSurfaceConfig (const std::string &deltaType, const std::string &atmType, const std::vector< std::string > &putDeltas, const std::vector< std::string > &callDeltas, const std::vector< std::string > &expiries, const std::string &timeInterpolation, const std::string &strikeInterpolation, bool extrapolation, const std::string &timeExtrapolation, const std::string &strikeExtrapolation, const std::string &atmDeltaType="", bool futurePriceCorrection=true, MarketDatum::QuoteType quoteType=MarketDatum::QuoteType::RATE_LNVOL, QuantLib::Exercise::Type exerciseType=QuantLib::Exercise::Type::European, std::string calendarStr=std::string(), QuantLib::Natural priority=0)
 Explicit constructor. More...
 
Inspectors
const std::string & deltaType () const
 
const std::string & atmType () const
 
const std::vector< std::string > & putDeltas () const
 
const std::vector< std::string > & callDeltas () const
 
const std::vector< std::string > & expiries () const
 
const std::string & atmDeltaType () const
 
bool futurePriceCorrection () const
 
VolatilitySurfaceConfig
std::vector< std::pair< std::string, std::string > > quotes () const override
 
- Public Member Functions inherited from VolatilitySurfaceConfig
 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. More...
 
 VolatilitySurfaceConfig (const std::string &timeInterpolation, const std::string &strikeInterpolation, bool extrapolation, const std::string &timeExtrapolation, const std::string &strikeExtrapolation, MarketDatum::QuoteType quoteType=MarketDatum::QuoteType::RATE_LNVOL, QuantLib::Exercise::Type exerciseType=QuantLib::Exercise::Type::European, std::string calendarStr=std::string(), QuantLib::Natural priority=0)
 Explicit constructor. More...
 
const std::string & timeInterpolation () const
 
const std::string & strikeInterpolation () const
 
bool extrapolation () const
 
const std::string & timeExtrapolation () const
 
const std::string & strikeExtrapolation () const
 
- Public Member Functions inherited from QuoteBasedVolatilityConfig
 QuoteBasedVolatilityConfig (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. More...
 
const MarketDatum::QuoteTypequoteType () const
 
const QuantLib::Exercise::Type & exerciseType () const
 
void fromBaseNode (ore::data::XMLNode *node)
 
void toBaseNode (ore::data::XMLDocument &doc, ore::data::XMLNode *node) const
 
- Public Member Functions inherited from VolatilityConfig
 VolatilityConfig (std::string calendarStr=std::string(), QuantLib::Natural priority=0)
 
void fromXMLNode (ore::data::XMLNode *node)
 
void toXMLNode (XMLDocument &doc, XMLNode *node) const
 
QuantLib::Natural priority () const
 
Calendar calendar () const
 
- 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...
 

Serialisation

std::string deltaType_
 
std::string atmType_
 
std::vector< std::string > putDeltas_
 
std::vector< std::string > callDeltas_
 
std::vector< std::string > expiries_
 
std::string atmDeltaType_
 
bool futurePriceCorrection_
 
void fromXML (ore::data::XMLNode *node) override
 
ore::data::XMLNodetoXML (ore::data::XMLDocument &doc) const override
 

Additional Inherited Members

- Protected Member Functions inherited from VolatilitySurfaceConfig
void fromNode (ore::data::XMLNode *node)
 
void addNodes (ore::data::XMLDocument &doc, ore::data::XMLNode *node) const
 

Detailed Description

Volatility configuration for a 2-D delta volatility surface

Definition at line 294 of file volatilityconfig.hpp.

Constructor & Destructor Documentation

◆ VolatilityDeltaSurfaceConfig() [1/2]

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.

◆ VolatilityDeltaSurfaceConfig() [2/2]

VolatilityDeltaSurfaceConfig ( const std::string &  deltaType,
const std::string &  atmType,
const std::vector< std::string > &  putDeltas,
const std::vector< std::string > &  callDeltas,
const std::vector< std::string > &  expiries,
const std::string &  timeInterpolation,
const std::string &  strikeInterpolation,
bool  extrapolation,
const std::string &  timeExtrapolation,
const std::string &  strikeExtrapolation,
const std::string &  atmDeltaType = "",
bool  futurePriceCorrection = true,
MarketDatum::QuoteType  quoteType = MarketDatum::QuoteType::RATE_LNVOL,
QuantLib::Exercise::Type  exerciseType = QuantLib::Exercise::Type::European,
std::string  calendarStr = std::string(),
QuantLib::Natural  priority = 0 
)

Explicit constructor.

Member Function Documentation

◆ deltaType()

const string & deltaType ( ) const

Definition at line 311 of file volatilityconfig.cpp.

+ Here is the caller graph for this function:

◆ atmType()

const string & atmType ( ) const

Definition at line 313 of file volatilityconfig.cpp.

+ Here is the caller graph for this function:

◆ putDeltas()

const vector< string > & putDeltas ( ) const

Definition at line 315 of file volatilityconfig.cpp.

315{ return putDeltas_; }
+ Here is the caller graph for this function:

◆ callDeltas()

const vector< string > & callDeltas ( ) const

Definition at line 317 of file volatilityconfig.cpp.

317{ return callDeltas_; }
+ Here is the caller graph for this function:

◆ expiries()

const vector< string > & expiries ( ) const

Definition at line 319 of file volatilityconfig.cpp.

319{ return expiries_; }
+ Here is the caller graph for this function:

◆ atmDeltaType()

const string & atmDeltaType ( ) const

Definition at line 321 of file volatilityconfig.cpp.

+ Here is the caller graph for this function:

◆ futurePriceCorrection()

bool futurePriceCorrection ( ) const

◆ quotes()

vector< pair< string, string > > quotes ( ) const
overridevirtual

Return a vector of pairs of expiry and strike. The first element in the pair is the expiry and the second element in the pair is the string representation of the strike. This will be useful for building the vector of quote strings in classes that have a VolatilitySurfaceConfig.

Implements VolatilitySurfaceConfig.

Definition at line 325 of file volatilityconfig.cpp.

325 {
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}
const std::vector< std::string > & expiries() const
+ Here is the call graph for this function:

◆ fromXML()

void fromXML ( ore::data::XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 350 of file volatilityconfig.cpp.

350 {
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}
void fromBaseNode(ore::data::XMLNode *node)
void fromNode(ore::data::XMLNode *node)
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 string getNodeValue(XMLNode *node)
Get a node's value.
Definition: xmlutils.cpp:489
static vector< string > getChildrenValuesAsStrings(XMLNode *node, const string &name, bool mandatory=false)
Definition: xmlutils.cpp:342
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( ore::data::XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 365 of file volatilityconfig.cpp.

365 {
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}
void toBaseNode(ore::data::XMLDocument &doc, ore::data::XMLNode *node) const
void addNodes(ore::data::XMLDocument &doc, ore::data::XMLNode *node) const
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
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
+ Here is the call graph for this function:

Member Data Documentation

◆ deltaType_

std::string deltaType_
private

Definition at line 335 of file volatilityconfig.hpp.

◆ atmType_

std::string atmType_
private

Definition at line 336 of file volatilityconfig.hpp.

◆ putDeltas_

std::vector<std::string> putDeltas_
private

Definition at line 337 of file volatilityconfig.hpp.

◆ callDeltas_

std::vector<std::string> callDeltas_
private

Definition at line 338 of file volatilityconfig.hpp.

◆ expiries_

std::vector<std::string> expiries_
private

Definition at line 339 of file volatilityconfig.hpp.

◆ atmDeltaType_

std::string atmDeltaType_
private

Definition at line 340 of file volatilityconfig.hpp.

◆ futurePriceCorrection_

bool futurePriceCorrection_
private

Definition at line 341 of file volatilityconfig.hpp.