Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
List of all members
FxOptionConvention Class Reference

Container for storing FX Option conventions. More...

#include <ored/configuration/conventions.hpp>

+ Inheritance diagram for FxOptionConvention:
+ Collaboration diagram for FxOptionConvention:

Public Member Functions

Constructors
 FxOptionConvention ()
 
 FxOptionConvention (const string &id, const string &fxConventionId, const string &atmType, const string &deltaType, const string &switchTenor="", const string &longTermAtmType="", const string &longTermDeltaType="", const string &riskReversalInFavorOf="Call", const string &butterflyStyle="Broker")
 
Inspectors
const string & fxConventionID () const
 
const DeltaVolQuote::AtmType & atmType () const
 
const DeltaVolQuote::DeltaType & deltaType () const
 
const Period & switchTenor () const
 
const DeltaVolQuote::AtmType & longTermAtmType () const
 
const DeltaVolQuote::DeltaType & longTermDeltaType () const
 
const QuantLib::Option::Type & riskReversalInFavorOf () const
 
const bool butterflyIsBrokerStyle () const
 
- Public Member Functions inherited from Convention
virtual ~Convention ()
 Default destructor. More...
 
const string & id () const
 
Type type () 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

string fxConventionID_
 
DeltaVolQuote::AtmType atmType_
 
DeltaVolQuote::AtmType longTermAtmType_
 
DeltaVolQuote::DeltaType deltaType_
 
DeltaVolQuote::DeltaType longTermDeltaType_
 
Period switchTenor_
 
QuantLib::Option::Type riskReversalInFavorOf_
 
bool butterflyIsBrokerStyle_
 
string strAtmType_
 
string strDeltaType_
 
string strSwitchTenor_
 
string strLongTermAtmType_
 
string strLongTermDeltaType_
 
string strRiskReversalInFavorOf_
 
string strButterflyStyle_
 
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 
virtual void build () override
 

Additional Inherited Members

- Public Types inherited from Convention
enum class  Type {
  Zero , Deposit , Future , FRA ,
  OIS , Swap , AverageOIS , TenorBasisSwap ,
  TenorBasisTwoSwap , BMABasisSwap , FX , CrossCcyBasis ,
  CrossCcyFixFloat , CDS , IborIndex , OvernightIndex ,
  SwapIndex , ZeroInflationIndex , InflationSwap , SecuritySpread ,
  CMSSpreadOption , CommodityForward , CommodityFuture , FxOption ,
  BondYield
}
 Supported convention types. More...
 
- Protected Member Functions inherited from Convention
 Convention ()
 
 Convention (const string &id, Type type)
 
- Protected Attributes inherited from Convention
Type type_
 
string id_
 

Detailed Description

Container for storing FX Option conventions.

Defining a switchTenor is optional. It is set to 0 * Days if no switch tenor is defined. In this case longTermAtmType and longTermDeltaType are set to atmType and deltaType respectively.

Definition at line 1698 of file conventions.hpp.

Constructor & Destructor Documentation

◆ FxOptionConvention() [1/2]

Definition at line 1702 of file conventions.hpp.

1702{}

◆ FxOptionConvention() [2/2]

FxOptionConvention ( const string &  id,
const string &  fxConventionId,
const string &  atmType,
const string &  deltaType,
const string &  switchTenor = "",
const string &  longTermAtmType = "",
const string &  longTermDeltaType = "",
const string &  riskReversalInFavorOf = "Call",
const string &  butterflyStyle = "Broker" 
)

Definition at line 2302 of file conventions.cpp.

2309 build();
2310}
const QuantLib::Option::Type & riskReversalInFavorOf() const
const DeltaVolQuote::DeltaType & deltaType() const
const string & fxConventionID() const
virtual void build() override
const DeltaVolQuote::DeltaType & longTermDeltaType() const
const DeltaVolQuote::AtmType & longTermAtmType() const
const Period & switchTenor() const
const DeltaVolQuote::AtmType & atmType() const
+ Here is the call graph for this function:

Member Function Documentation

◆ fxConventionID()

const string & fxConventionID ( ) const

Definition at line 1711 of file conventions.hpp.

1711{ return fxConventionID_; }

◆ atmType()

const DeltaVolQuote::AtmType & atmType ( ) const

Definition at line 1712 of file conventions.hpp.

1712{ return atmType_; }
DeltaVolQuote::AtmType atmType_

◆ deltaType()

const DeltaVolQuote::DeltaType & deltaType ( ) const

Definition at line 1713 of file conventions.hpp.

1713{ return deltaType_; }
DeltaVolQuote::DeltaType deltaType_

◆ switchTenor()

const Period & switchTenor ( ) const

Definition at line 1714 of file conventions.hpp.

1714{ return switchTenor_; }

◆ longTermAtmType()

const DeltaVolQuote::AtmType & longTermAtmType ( ) const

Definition at line 1715 of file conventions.hpp.

1715{ return longTermAtmType_; }
DeltaVolQuote::AtmType longTermAtmType_

◆ longTermDeltaType()

const DeltaVolQuote::DeltaType & longTermDeltaType ( ) const

Definition at line 1716 of file conventions.hpp.

1716{ return longTermDeltaType_; }
DeltaVolQuote::DeltaType longTermDeltaType_

◆ riskReversalInFavorOf()

const QuantLib::Option::Type & riskReversalInFavorOf ( ) const

Definition at line 1717 of file conventions.hpp.

1717{ return riskReversalInFavorOf_; }
QuantLib::Option::Type riskReversalInFavorOf_

◆ butterflyIsBrokerStyle()

const bool butterflyIsBrokerStyle ( ) const

Definition at line 1718 of file conventions.hpp.

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 2338 of file conventions.cpp.

2338 {
2339
2340 XMLUtils::checkNode(node, "FxOption");
2342 id_ = XMLUtils::getChildValue(node, "Id", true);
2343 fxConventionID_ = XMLUtils::getChildValue(node, "FXConventionID", false);
2344
2345 // Get string values from xml
2346 strAtmType_ = XMLUtils::getChildValue(node, "AtmType", true);
2347 strDeltaType_ = XMLUtils::getChildValue(node, "DeltaType", true);
2348 strSwitchTenor_ = XMLUtils::getChildValue(node, "SwitchTenor", false);
2349 strLongTermAtmType_ = XMLUtils::getChildValue(node, "LongTermAtmType", false);
2350 strLongTermDeltaType_ = XMLUtils::getChildValue(node, "LongTermDeltaType", false);
2351 strRiskReversalInFavorOf_ = XMLUtils::getChildValue(node, "RiskReversalInFavorOf", false);
2352 strButterflyStyle_ = XMLUtils::getChildValue(node, "ButterflyStyle", false);
2353 build();
2354}
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
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 2356 of file conventions.cpp.

2356 {
2357
2358 XMLNode* node = doc.allocNode("FxOption");
2359 XMLUtils::addChild(doc, node, "Id", id_);
2360 XMLUtils::addChild(doc, node, "FXConventionID", fxConventionID_);
2361 XMLUtils::addChild(doc, node, "AtmType", strAtmType_);
2362 XMLUtils::addChild(doc, node, "DeltaType", strDeltaType_);
2363 XMLUtils::addChild(doc, node, "SwitchTenor", strSwitchTenor_);
2364 XMLUtils::addChild(doc, node, "LongTermAtmType", strLongTermAtmType_);
2365 XMLUtils::addChild(doc, node, "LongTermDeltaType", strLongTermDeltaType_);
2366 XMLUtils::addChild(doc, node, "RiskReversalInFavorOf", strRiskReversalInFavorOf_);
2367 XMLUtils::addChild(doc, node, "ButterflyStyle", strButterflyStyle_);
2368 return node;
2369}
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

◆ build()

void build ( )
overridevirtual

Implements Convention.

Definition at line 2312 of file conventions.cpp.

2312 {
2315 if (!strSwitchTenor_.empty()) {
2319 } else {
2320 switchTenor_ = 0 * Days;
2323 }
2324 if (!strRiskReversalInFavorOf_.empty()) {
2326 } else {
2327 riskReversalInFavorOf_ = Option::Call;
2328 }
2329 if (strButterflyStyle_.empty() || strButterflyStyle_ == "Broker") {
2331 } else if (strButterflyStyle_ == "Smile") {
2333 } else {
2334 QL_FAIL("invalid butterfly style '" << strButterflyStyle_ << "', expected Broker or Smile");
2335 }
2336}
Period parsePeriod(const string &s)
Convert text to QuantLib::Period.
Definition: parsers.cpp:171
DeltaVolQuote::AtmType parseAtmType(const std::string &s)
Convert text to QuantLib::DeltaVolQuote::AtmType.
Definition: parsers.cpp:746
Option::Type parseOptionType(const std::string &s)
Convert text to QuantLib::Option::Type.
Definition: parsers.cpp:481
DeltaVolQuote::DeltaType parseDeltaType(const std::string &s)
Convert text to QuantLib::DeltaVolQuote::DeltaType.
Definition: parsers.cpp:763
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ fxConventionID_

string fxConventionID_
private

Definition at line 1728 of file conventions.hpp.

◆ atmType_

DeltaVolQuote::AtmType atmType_
private

Definition at line 1729 of file conventions.hpp.

◆ longTermAtmType_

DeltaVolQuote::AtmType longTermAtmType_
private

Definition at line 1729 of file conventions.hpp.

◆ deltaType_

DeltaVolQuote::DeltaType deltaType_
private

Definition at line 1730 of file conventions.hpp.

◆ longTermDeltaType_

DeltaVolQuote::DeltaType longTermDeltaType_
private

Definition at line 1730 of file conventions.hpp.

◆ switchTenor_

Period switchTenor_
private

Definition at line 1731 of file conventions.hpp.

◆ riskReversalInFavorOf_

QuantLib::Option::Type riskReversalInFavorOf_
private

Definition at line 1732 of file conventions.hpp.

◆ butterflyIsBrokerStyle_

bool butterflyIsBrokerStyle_
private

Definition at line 1733 of file conventions.hpp.

◆ strAtmType_

string strAtmType_
private

Definition at line 1736 of file conventions.hpp.

◆ strDeltaType_

string strDeltaType_
private

Definition at line 1737 of file conventions.hpp.

◆ strSwitchTenor_

string strSwitchTenor_
private

Definition at line 1738 of file conventions.hpp.

◆ strLongTermAtmType_

string strLongTermAtmType_
private

Definition at line 1739 of file conventions.hpp.

◆ strLongTermDeltaType_

string strLongTermDeltaType_
private

Definition at line 1740 of file conventions.hpp.

◆ strRiskReversalInFavorOf_

string strRiskReversalInFavorOf_
private

Definition at line 1741 of file conventions.hpp.

◆ strButterflyStyle_

string strButterflyStyle_
private

Definition at line 1742 of file conventions.hpp.