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

#include <ored/configuration/volatilityconfig.hpp>

+ Inheritance diagram for VolatilityMoneynessSurfaceConfig:
+ Collaboration diagram for VolatilityMoneynessSurfaceConfig:

Public Member Functions

 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. More...
 
 VolatilityMoneynessSurfaceConfig (const std::string &moneynessType, const std::vector< std::string > &moneynessLevels, const std::vector< std::string > &expiries, const std::string &timeInterpolation, const std::string &strikeInterpolation, bool extrapolation, const std::string &timeExtrapolation, const std::string &strikeExtrapolation, 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 & moneynessType () const
 
const std::vector< std::string > & moneynessLevels () const
 
const std::vector< std::string > & expiries () 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 moneynessType_
 
std::vector< std::string > moneynessLevels_
 
std::vector< std::string > expiries_
 
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 moneyness volatility surface

Definition at line 347 of file volatilityconfig.hpp.

Constructor & Destructor Documentation

◆ VolatilityMoneynessSurfaceConfig() [1/2]

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.

◆ VolatilityMoneynessSurfaceConfig() [2/2]

VolatilityMoneynessSurfaceConfig ( const std::string &  moneynessType,
const std::vector< std::string > &  moneynessLevels,
const std::vector< std::string > &  expiries,
const std::string &  timeInterpolation,
const std::string &  strikeInterpolation,
bool  extrapolation,
const std::string &  timeExtrapolation,
const std::string &  strikeExtrapolation,
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

◆ moneynessType()

const string & moneynessType ( ) const

Definition at line 395 of file volatilityconfig.cpp.

◆ moneynessLevels()

const vector< string > & moneynessLevels ( ) const

Definition at line 397 of file volatilityconfig.cpp.

397{ return moneynessLevels_; }

◆ expiries()

const vector< string > & expiries ( ) const

Definition at line 399 of file volatilityconfig.cpp.

399{ return expiries_; }
+ 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 403 of file volatilityconfig.cpp.

403 {
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}
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 419 of file volatilityconfig.cpp.

419 {
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}
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 431 of file volatilityconfig.cpp.

431 {
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}
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

◆ moneynessType_

std::string moneynessType_
private

Definition at line 384 of file volatilityconfig.hpp.

◆ moneynessLevels_

std::vector<std::string> moneynessLevels_
private

Definition at line 385 of file volatilityconfig.hpp.

◆ expiries_

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

Definition at line 386 of file volatilityconfig.hpp.

◆ futurePriceCorrection_

bool futurePriceCorrection_
private

Definition at line 387 of file volatilityconfig.hpp.