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

#include <ored/configuration/volatilityconfig.hpp>

+ Inheritance diagram for VolatilitySurfaceConfig:
+ Collaboration diagram for VolatilitySurfaceConfig:

Public Member Functions

 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...
 
- 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...
 

Inspectors

std::string timeInterpolation_
 
std::string strikeInterpolation_
 
bool extrapolation_
 
std::string timeExtrapolation_
 
std::string strikeExtrapolation_
 
const std::string & timeInterpolation () const
 
const std::string & strikeInterpolation () const
 
bool extrapolation () const
 
const std::string & timeExtrapolation () const
 
const std::string & strikeExtrapolation () const
 
virtual std::vector< std::pair< std::string, std::string > > quotes () const =0
 
void fromNode (ore::data::XMLNode *node)
 
void addNodes (ore::data::XMLDocument &doc, ore::data::XMLNode *node) const
 

Detailed Description

Base volatility configuration for a 2-D volatility surface

Definition at line 203 of file volatilityconfig.hpp.

Constructor & Destructor Documentation

◆ VolatilitySurfaceConfig() [1/2]

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.

◆ VolatilitySurfaceConfig() [2/2]

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.

Member Function Documentation

◆ timeInterpolation()

const string & timeInterpolation ( ) const

Definition at line 223 of file volatilityconfig.cpp.

+ Here is the caller graph for this function:

◆ strikeInterpolation()

const string & strikeInterpolation ( ) const

Definition at line 225 of file volatilityconfig.cpp.

+ Here is the caller graph for this function:

◆ extrapolation()

bool extrapolation ( ) const

Definition at line 227 of file volatilityconfig.cpp.

+ Here is the caller graph for this function:

◆ timeExtrapolation()

const string & timeExtrapolation ( ) const

Definition at line 229 of file volatilityconfig.cpp.

+ Here is the caller graph for this function:

◆ strikeExtrapolation()

const string & strikeExtrapolation ( ) const

Definition at line 231 of file volatilityconfig.cpp.

+ Here is the caller graph for this function:

◆ quotes()

virtual std::vector< std::pair< std::string, std::string > > quotes ( ) const
pure virtual

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.

Implemented in VolatilityStrikeSurfaceConfig, VolatilityDeltaSurfaceConfig, VolatilityMoneynessSurfaceConfig, and VolatilityApoFutureSurfaceConfig.

◆ fromNode()

void fromNode ( ore::data::XMLNode node)
protected

Populate members from the provided node. Can be called by fromXML in derived classes.

Definition at line 233 of file volatilityconfig.cpp.

233 {
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}
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addNodes()

void addNodes ( ore::data::XMLDocument doc,
ore::data::XMLNode node 
) const
protected

Add members to the provided node. Can be called by toXML in derived classes.

Definition at line 241 of file volatilityconfig.cpp.

241 {
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}
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ timeInterpolation_

std::string timeInterpolation_
private

Definition at line 243 of file volatilityconfig.hpp.

◆ strikeInterpolation_

std::string strikeInterpolation_
private

Definition at line 244 of file volatilityconfig.hpp.

◆ extrapolation_

bool extrapolation_
private

Definition at line 245 of file volatilityconfig.hpp.

◆ timeExtrapolation_

std::string timeExtrapolation_
private

Definition at line 246 of file volatilityconfig.hpp.

◆ strikeExtrapolation_

std::string strikeExtrapolation_
private

Definition at line 247 of file volatilityconfig.hpp.