Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
wrappedmarket.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file ored/marketdata/wrappedmarket.hpp
20 \brief wrapped market
21 \ingroup marketdata
22*/
23
24#pragma once
25
27
28namespace ore {
29namespace data {
30
31//! Wrapped Market
32/*!
33 All incoming requests are passed through to an underlying market. This class can be used to override single
34 methods for special markets. For example a derived class can override the securitySpread() method and
35 return a dedicated simple quote handle that can be used to imply a bond spread. Another example is a market
36 returning commodity term structures as fx term structures for precious metals.
37
38 \ingroup marketdata
39*/
40class WrappedMarket : public Market {
41public:
42 WrappedMarket(const QuantLib::ext::shared_ptr<Market>& market, const bool handlePseudoCurrencies);
43 QuantLib::ext::shared_ptr<Market> underlyingMarket() const;
44
45 // market interface
46 Date asofDate() const override;
47 Handle<YieldTermStructure> yieldCurve(const YieldCurveType& type, const string& name,
48 const string& configuration = Market::defaultConfiguration) const override;
49 Handle<YieldTermStructure> discountCurveImpl(const string& ccy,
50 const string& configuration = Market::defaultConfiguration) const override;
51 Handle<YieldTermStructure> yieldCurve(const string& name,
52 const string& configuration = Market::defaultConfiguration) const override;
53 Handle<IborIndex> iborIndex(const string& indexName,
54 const string& configuration = Market::defaultConfiguration) const override;
55 Handle<SwapIndex> swapIndex(const string& indexName,
56 const string& configuration = Market::defaultConfiguration) const override;
57 Handle<SwaptionVolatilityStructure>
58 swaptionVol(const string& key, const string& configuration = Market::defaultConfiguration) const override;
59 string shortSwapIndexBase(const string& ccy,
60 const string& configuration = Market::defaultConfiguration) const override;
61 string swapIndexBase(const string& ccy,
62 const string& configuration = Market::defaultConfiguration) const override;
63 Handle<SwaptionVolatilityStructure>
64 yieldVol(const string& securityID, const string& configuration = Market::defaultConfiguration) const override;
65 Handle<QuantExt::FxIndex> fxIndexImpl(const string& fxIndex,
66 const string& configuration = Market::defaultConfiguration) const override;
67 Handle<Quote> fxSpotImpl(const string& ccypair,
68 const string& configuration = Market::defaultConfiguration) const override;
69 Handle<Quote> fxRateImpl(const string& ccypair,
70 const string& configuration = Market::defaultConfiguration) const override;
71 Handle<BlackVolTermStructure> fxVolImpl(const string& ccypair,
72 const string& configuration = Market::defaultConfiguration) const override;
73 Handle<QuantExt::CreditCurve>
74 defaultCurve(const string& name, const string& configuration = Market::defaultConfiguration) const override;
75 Handle<Quote> recoveryRate(const string& name,
76 const string& configuration = Market::defaultConfiguration) const override;
77 Handle<QuantExt::CreditVolCurve> cdsVol(const string& name,
78 const string& configuration = Market::defaultConfiguration) const override;
79 Handle<QuantExt::BaseCorrelationTermStructure>
80 baseCorrelation(const string& name, const string& configuration = Market::defaultConfiguration) const override;
81 Handle<OptionletVolatilityStructure>
82 capFloorVol(const string& key, const string& configuration = Market::defaultConfiguration) const override;
83 std::pair<string, QuantLib::Period>
84 capFloorVolIndexBase(const string& key, const string& configuration = Market::defaultConfiguration) const override;
85 Handle<QuantExt::YoYOptionletVolatilitySurface>
86 yoyCapFloorVol(const string& indexName, const string& configuration = Market::defaultConfiguration) const override;
87 Handle<ZeroInflationIndex>
88 zeroInflationIndex(const string& indexName,
89 const string& configuration = Market::defaultConfiguration) const override;
90 Handle<YoYInflationIndex>
91 yoyInflationIndex(const string& indexName,
92 const string& configuration = Market::defaultConfiguration) const override;
93 Handle<CPIVolatilitySurface>
94 cpiInflationCapFloorVolatilitySurface(const string& indexName,
95 const string& configuration = Market::defaultConfiguration) const override;
96 Handle<Quote> equitySpot(const string& eqName,
97 const string& configuration = Market::defaultConfiguration) const override;
98 Handle<YieldTermStructure>
99 equityDividendCurve(const string& eqName,
100 const string& configuration = Market::defaultConfiguration) const override;
101 Handle<YieldTermStructure>
102 equityForecastCurve(const string& eqName,
103 const string& configuration = Market::defaultConfiguration) const override;
104 Handle<QuantExt::EquityIndex2>
105 equityCurve(const string& eqName, const string& configuration = Market::defaultConfiguration) const override;
106 Handle<BlackVolTermStructure> equityVol(const string& eqName,
107 const string& configuration = Market::defaultConfiguration) const override;
108 void refresh(const string& s) override;
109
110 Handle<Quote> securitySpread(const string& securityID,
111 const string& configuration = Market::defaultConfiguration) const override;
112 QuantLib::Handle<QuantExt::PriceTermStructure>
113 commodityPriceCurve(const std::string& commodityName,
114 const std::string& configuration = Market::defaultConfiguration) const override;
115 QuantLib::Handle<QuantExt::CommodityIndex> commodityIndex(const std::string& commodityName,
116 const std::string& configuration = Market::defaultConfiguration) const override;
117 QuantLib::Handle<QuantLib::BlackVolTermStructure>
118 commodityVolatility(const std::string& commodityName,
119 const std::string& configuration = Market::defaultConfiguration) const override;
120 QuantLib::Handle<QuantExt::CorrelationTermStructure>
121 correlationCurve(const std::string& index1, const std::string& index2,
122 const std::string& configuration = Market::defaultConfiguration) const override;
123 Handle<Quote> cpr(const string& securityID,
124 const string& configuration = Market::defaultConfiguration) const override;
125
126protected:
127 QuantLib::ext::shared_ptr<Market> market_;
128};
129
130} // namespace data
131} // namespace ore
QuantLib::Handle< QuantExt::FxIndex > fxIndex(const string &fxIndex, const string &configuration=Market::defaultConfiguration) const
Definition: market.cpp:151
static const string defaultConfiguration
Default configuration label.
Definition: market.hpp:296
bool handlePseudoCurrencies() const
Definition: market.hpp:339
QuantLib::ext::shared_ptr< Market > market_
Handle< QuantExt::CreditCurve > defaultCurve(const string &name, const string &configuration=Market::defaultConfiguration) const override
string shortSwapIndexBase(const string &ccy, const string &configuration=Market::defaultConfiguration) const override
Handle< Quote > securitySpread(const string &securityID, const string &configuration=Market::defaultConfiguration) const override
Handle< QuantExt::BaseCorrelationTermStructure > baseCorrelation(const string &name, const string &configuration=Market::defaultConfiguration) const override
QuantLib::Handle< QuantExt::PriceTermStructure > commodityPriceCurve(const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const override
Handle< ZeroInflationIndex > zeroInflationIndex(const string &indexName, const string &configuration=Market::defaultConfiguration) const override
Inflation Indexes.
Handle< QuantExt::EquityIndex2 > equityCurve(const string &eqName, const string &configuration=Market::defaultConfiguration) const override
Handle< BlackVolTermStructure > equityVol(const string &eqName, const string &configuration=Market::defaultConfiguration) const override
Handle< QuantExt::YoYOptionletVolatilitySurface > yoyCapFloorVol(const string &indexName, const string &configuration=Market::defaultConfiguration) const override
Handle< Quote > recoveryRate(const string &name, const string &configuration=Market::defaultConfiguration) const override
Handle< YieldTermStructure > discountCurveImpl(const string &ccy, const string &configuration=Market::defaultConfiguration) const override
QuantLib::Handle< QuantLib::BlackVolTermStructure > commodityVolatility(const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const override
Handle< Quote > fxSpotImpl(const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
Handle< BlackVolTermStructure > fxVolImpl(const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
Handle< SwaptionVolatilityStructure > yieldVol(const string &securityID, const string &configuration=Market::defaultConfiguration) const override
Handle< CPIVolatilitySurface > cpiInflationCapFloorVolatilitySurface(const string &indexName, const string &configuration=Market::defaultConfiguration) const override
CPI Inflation Cap Floor Volatility Surfaces.
Handle< QuantExt::CreditVolCurve > cdsVol(const string &name, const string &configuration=Market::defaultConfiguration) const override
Date asofDate() const override
Get the asof Date.
QuantLib::Handle< QuantExt::CorrelationTermStructure > correlationCurve(const std::string &index1, const std::string &index2, const std::string &configuration=Market::defaultConfiguration) const override
void refresh(const string &s) override
Refresh term structures for a given configuration.
Handle< YieldTermStructure > equityDividendCurve(const string &eqName, const string &configuration=Market::defaultConfiguration) const override
Handle< QuantExt::FxIndex > fxIndexImpl(const string &fxIndex, const string &configuration=Market::defaultConfiguration) const override
Handle< YieldTermStructure > yieldCurve(const YieldCurveType &type, const string &name, const string &configuration=Market::defaultConfiguration) const override
Handle< Quote > cpr(const string &securityID, const string &configuration=Market::defaultConfiguration) const override
Handle< Quote > fxRateImpl(const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
Handle< Quote > equitySpot(const string &eqName, const string &configuration=Market::defaultConfiguration) const override
string swapIndexBase(const string &ccy, const string &configuration=Market::defaultConfiguration) const override
Handle< SwapIndex > swapIndex(const string &indexName, const string &configuration=Market::defaultConfiguration) const override
QuantLib::ext::shared_ptr< Market > underlyingMarket() const
std::pair< string, QuantLib::Period > capFloorVolIndexBase(const string &key, const string &configuration=Market::defaultConfiguration) const override
Handle< OptionletVolatilityStructure > capFloorVol(const string &key, const string &configuration=Market::defaultConfiguration) const override
Handle< YoYInflationIndex > yoyInflationIndex(const string &indexName, const string &configuration=Market::defaultConfiguration) const override
Handle< SwaptionVolatilityStructure > swaptionVol(const string &key, const string &configuration=Market::defaultConfiguration) const override
Handle< IborIndex > iborIndex(const string &indexName, const string &configuration=Market::defaultConfiguration) const override
QuantLib::Handle< QuantExt::CommodityIndex > commodityIndex(const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const override
Handle< YieldTermStructure > equityForecastCurve(const string &eqName, const string &configuration=Market::defaultConfiguration) const override
@ data
Definition: log.hpp:77
Base Market class.
YieldCurveType
Definition: market.hpp:59
Serializable Credit Default Swap.
Definition: namespaces.docs:23
string name