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

Wrapped Market. More...

#include <ored/marketdata/wrappedmarket.hpp>

+ Inheritance diagram for WrappedMarket:
+ Collaboration diagram for WrappedMarket:

Public Member Functions

 WrappedMarket (const QuantLib::ext::shared_ptr< Market > &market, const bool handlePseudoCurrencies)
 
QuantLib::ext::shared_ptr< MarketunderlyingMarket () const
 
Date asofDate () const override
 Get the asof Date. More...
 
Handle< YieldTermStructure > yieldCurve (const YieldCurveType &type, const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > discountCurveImpl (const string &ccy, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > yieldCurve (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< IborIndexiborIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< SwapIndex > swapIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< SwaptionVolatilityStructureswaptionVol (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
string shortSwapIndexBase (const string &ccy, const string &configuration=Market::defaultConfiguration) const override
 
string swapIndexBase (const string &ccy, const string &configuration=Market::defaultConfiguration) const override
 
Handle< SwaptionVolatilityStructureyieldVol (const string &securityID, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::FxIndexfxIndexImpl (const string &fxIndex, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > fxSpotImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > fxRateImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
 
Handle< BlackVolTermStructurefxVolImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::CreditCurvedefaultCurve (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > recoveryRate (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::CreditVolCurvecdsVol (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::BaseCorrelationTermStructurebaseCorrelation (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< OptionletVolatilityStructure > capFloorVol (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
std::pair< string, QuantLib::Period > capFloorVolIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::YoYOptionletVolatilitySurface > yoyCapFloorVol (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< ZeroInflationIndex > zeroInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 Inflation Indexes. More...
 
Handle< YoYInflationIndex > yoyInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< CPIVolatilitySurfacecpiInflationCapFloorVolatilitySurface (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 CPI Inflation Cap Floor Volatility Surfaces. More...
 
Handle< Quote > equitySpot (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > equityDividendCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > equityForecastCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::EquityIndex2equityCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< BlackVolTermStructureequityVol (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
void refresh (const string &s) override
 Refresh term structures for a given configuration. More...
 
Handle< Quote > securitySpread (const string &securityID, const string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantExt::PriceTermStructurecommodityPriceCurve (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantExt::CommodityIndexcommodityIndex (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantLib::BlackVolTermStructure > commodityVolatility (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantExt::CorrelationTermStructurecorrelationCurve (const std::string &index1, const std::string &index2, const std::string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > cpr (const string &securityID, const string &configuration=Market::defaultConfiguration) const override
 
- Public Member Functions inherited from Market
 Market (const bool handlePseudoCurrencies)
 Constructor. More...
 
virtual ~Market ()
 Destructor. More...
 
virtual Date asofDate () const =0
 Get the asof Date. More...
 
Handle< YieldTermStructure > discountCurve (const string &ccy, const string &configuration=Market::defaultConfiguration) const
 
QuantLib::Handle< QuantExt::FxIndexfxIndex (const string &fxIndex, const string &configuration=Market::defaultConfiguration) const
 
Handle< Quote > fxRate (const string &ccypair, const string &configuration=Market::defaultConfiguration) const
 
Handle< Quote > fxSpot (const string &ccypair, const string &configuration=Market::defaultConfiguration) const
 
Handle< BlackVolTermStructurefxVol (const string &ccypair, const string &configuration=Market::defaultConfiguration) const
 
string commodityCurveLookup (const string &pm) const
 
bool handlePseudoCurrencies () const
 

Protected Attributes

QuantLib::ext::shared_ptr< Marketmarket_
 
- Protected Attributes inherited from Market
bool handlePseudoCurrencies_ = false
 

Additional Inherited Members

- Static Public Attributes inherited from Market
static const string defaultConfiguration = "default"
 Default configuration label. More...
 
static const string inCcyConfiguration = "inccy"
 InCcy configuration label. More...
 

Detailed Description

Wrapped Market.

All incoming requests are passed through to an underlying market. This class can be used to override single methods for special markets. For example a derived class can override the securitySpread() method and return a dedicated simple quote handle that can be used to imply a bond spread. Another example is a market returning commodity term structures as fx term structures for precious metals.

Definition at line 40 of file wrappedmarket.hpp.

Constructor & Destructor Documentation

◆ WrappedMarket()

WrappedMarket ( const QuantLib::ext::shared_ptr< Market > &  market,
const bool  handlePseudoCurrencies 
)

Definition at line 24 of file wrappedmarket.cpp.

bool handlePseudoCurrencies() const
Definition: market.hpp:339
Market(const bool handlePseudoCurrencies)
Constructor.
Definition: market.hpp:166
QuantLib::ext::shared_ptr< Market > market_

Member Function Documentation

◆ underlyingMarket()

QuantLib::ext::shared_ptr< Market > underlyingMarket ( ) const

Definition at line 27 of file wrappedmarket.cpp.

27{ return market_; }

◆ asofDate()

Date asofDate ( ) const
overridevirtual

Get the asof Date.

Implements Market.

Definition at line 29 of file wrappedmarket.cpp.

29{ return market_->asofDate(); }

◆ yieldCurve() [1/2]

Handle< YieldTermStructure > yieldCurve ( const YieldCurveType type,
const string &  name,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 31 of file wrappedmarket.cpp.

32 {
33 return market_->yieldCurve(type, name, configuration);
34}
string name

◆ discountCurveImpl()

Handle< YieldTermStructure > discountCurveImpl ( const string &  ccy,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 36 of file wrappedmarket.cpp.

36 {
37 return market_->discountCurve(ccy, configuration);
38}

◆ yieldCurve() [2/2]

Handle< YieldTermStructure > yieldCurve ( const string &  name,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 40 of file wrappedmarket.cpp.

40 {
41 return market_->yieldCurve(name, configuration);
42}

◆ iborIndex()

Handle< IborIndex > iborIndex ( const string &  indexName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 44 of file wrappedmarket.cpp.

44 {
45 return market_->iborIndex(indexName, configuration);
46}

◆ swapIndex()

Handle< SwapIndex > swapIndex ( const string &  indexName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 48 of file wrappedmarket.cpp.

48 {
49 return market_->swapIndex(indexName, configuration);
50}

◆ swaptionVol()

Handle< SwaptionVolatilityStructure > swaptionVol ( const string &  key,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 52 of file wrappedmarket.cpp.

52 {
53 return market_->swaptionVol(key, configuration);
54}

◆ shortSwapIndexBase()

string shortSwapIndexBase ( const string &  ccy,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 56 of file wrappedmarket.cpp.

56 {
57 return market_->shortSwapIndexBase(ccy, configuration);
58}

◆ swapIndexBase()

string swapIndexBase ( const string &  ccy,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 60 of file wrappedmarket.cpp.

60 {
61 return market_->swapIndexBase(ccy, configuration);
62}

◆ yieldVol()

Handle< SwaptionVolatilityStructure > yieldVol ( const string &  securityID,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 64 of file wrappedmarket.cpp.

65 {
66 return market_->yieldVol(securityID, configuration);
67}

◆ fxIndexImpl()

Handle< QuantExt::FxIndex > fxIndexImpl ( const string &  fxIndex,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 69 of file wrappedmarket.cpp.

69 {
70 return market_->fxIndex(fxIndex, configuration);
71}
QuantLib::Handle< QuantExt::FxIndex > fxIndex(const string &fxIndex, const string &configuration=Market::defaultConfiguration) const
Definition: market.cpp:151
+ Here is the call graph for this function:

◆ fxSpotImpl()

Handle< Quote > fxSpotImpl ( const string &  ccypair,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 73 of file wrappedmarket.cpp.

73 {
74 return market_->fxSpot(ccypair, configuration);
75}

◆ fxRateImpl()

Handle< Quote > fxRateImpl ( const string &  ccypair,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 77 of file wrappedmarket.cpp.

77 {
78 return market_->fxRate(ccypair, configuration);
79}

◆ fxVolImpl()

Handle< BlackVolTermStructure > fxVolImpl ( const string &  ccypair,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 81 of file wrappedmarket.cpp.

81 {
82 return market_->fxVol(ccypair, configuration);
83}

◆ defaultCurve()

Handle< QuantExt::CreditCurve > defaultCurve ( const string &  name,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 85 of file wrappedmarket.cpp.

85 {
86 return market_->defaultCurve(name, configuration);
87}

◆ recoveryRate()

Handle< Quote > recoveryRate ( const string &  name,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 89 of file wrappedmarket.cpp.

89 {
90 return market_->recoveryRate(name, configuration);
91}

◆ cdsVol()

Handle< QuantExt::CreditVolCurve > cdsVol ( const string &  name,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 93 of file wrappedmarket.cpp.

93 {
94 return market_->cdsVol(name, configuration);
95}

◆ baseCorrelation()

Handle< QuantExt::BaseCorrelationTermStructure > baseCorrelation ( const string &  name,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 97 of file wrappedmarket.cpp.

98 {
99 return market_->baseCorrelation(name, configuration);
100}

◆ capFloorVol()

Handle< OptionletVolatilityStructure > capFloorVol ( const string &  key,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 102 of file wrappedmarket.cpp.

102 {
103 return market_->capFloorVol(key, configuration);
104}

◆ capFloorVolIndexBase()

std::pair< string, QuantLib::Period > capFloorVolIndexBase ( const string &  key,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 106 of file wrappedmarket.cpp.

107 {
108 return market_->capFloorVolIndexBase(key, configuration);
109}

◆ yoyCapFloorVol()

Handle< QuantExt::YoYOptionletVolatilitySurface > yoyCapFloorVol ( const string &  indexName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 111 of file wrappedmarket.cpp.

112 {
113 return market_->yoyCapFloorVol(indexName, configuration);
114}

◆ zeroInflationIndex()

Handle< ZeroInflationIndex > zeroInflationIndex ( const string &  indexName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Inflation Indexes.

Implements Market.

Definition at line 116 of file wrappedmarket.cpp.

117 {
118 return market_->zeroInflationIndex(indexName, configuration);
119}

◆ yoyInflationIndex()

Handle< YoYInflationIndex > yoyInflationIndex ( const string &  indexName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 121 of file wrappedmarket.cpp.

121 {
122 return market_->yoyInflationIndex(indexName, configuration);
123}

◆ cpiInflationCapFloorVolatilitySurface()

Handle< CPIVolatilitySurface > cpiInflationCapFloorVolatilitySurface ( const string &  indexName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

CPI Inflation Cap Floor Volatility Surfaces.

Implements Market.

Definition at line 125 of file wrappedmarket.cpp.

126 {
127 return market_->cpiInflationCapFloorVolatilitySurface(indexName, configuration);
128}

◆ equitySpot()

Handle< Quote > equitySpot ( const string &  eqName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 130 of file wrappedmarket.cpp.

130 {
131 return market_->equitySpot(eqName, configuration);
132}

◆ equityDividendCurve()

Handle< YieldTermStructure > equityDividendCurve ( const string &  eqName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 134 of file wrappedmarket.cpp.

134 {
135 return market_->equityDividendCurve(eqName, configuration);
136}

◆ equityForecastCurve()

Handle< YieldTermStructure > equityForecastCurve ( const string &  eqName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 138 of file wrappedmarket.cpp.

138 {
139 return market_->equityForecastCurve(eqName, configuration);
140}

◆ equityCurve()

Handle< QuantExt::EquityIndex2 > equityCurve ( const string &  eqName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 142 of file wrappedmarket.cpp.

142 {
143 return market_->equityCurve(eqName, configuration);
144}

◆ equityVol()

Handle< BlackVolTermStructure > equityVol ( const string &  eqName,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 146 of file wrappedmarket.cpp.

146 {
147 return market_->equityVol(eqName, configuration);
148}

◆ refresh()

void refresh ( const string &  )
overridevirtual

Refresh term structures for a given configuration.

Reimplemented from Market.

Definition at line 150 of file wrappedmarket.cpp.

150{ market_->refresh(s); }

◆ securitySpread()

Handle< Quote > securitySpread ( const string &  securityID,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 152 of file wrappedmarket.cpp.

152 {
153 return market_->securitySpread(securityID, configuration);
154}

◆ commodityPriceCurve()

QuantLib::Handle< QuantExt::PriceTermStructure > commodityPriceCurve ( const std::string &  commodityName,
const std::string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 157 of file wrappedmarket.cpp.

157 {
158 return market_->commodityPriceCurve(commodityName, configuration);
159}

◆ commodityIndex()

QuantLib::Handle< QuantExt::CommodityIndex > commodityIndex ( const std::string &  commodityName,
const std::string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 161 of file wrappedmarket.cpp.

162 {
163 return market_->commodityIndex(commodityName, configuration);
164}

◆ commodityVolatility()

QuantLib::Handle< QuantLib::BlackVolTermStructure > commodityVolatility ( const std::string &  commodityName,
const std::string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 167 of file wrappedmarket.cpp.

167 {
168 return market_->commodityVolatility(commodityName, configuration);
169}

◆ correlationCurve()

QuantLib::Handle< QuantExt::CorrelationTermStructure > correlationCurve ( const std::string &  index1,
const std::string &  index2,
const std::string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 172 of file wrappedmarket.cpp.

173 {
174 return market_->correlationCurve(index1, index2, configuration);
175}

◆ cpr()

Handle< Quote > cpr ( const string &  securityID,
const string &  configuration = Market::defaultConfiguration 
) const
overridevirtual

Implements Market.

Definition at line 177 of file wrappedmarket.cpp.

177 {
178 return market_->cpr(securityID, configuration);
179}

Member Data Documentation

◆ market_

QuantLib::ext::shared_ptr<Market> market_
protected

Definition at line 127 of file wrappedmarket.hpp.