Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equityvolcurve.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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/equityvolcurve.hpp
20 \brief Wrapper class for building Equity volatility structures
21 \ingroup curves
22*/
23
24#pragma once
25
32#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
33
34namespace ore {
35namespace data {
37using QuantLib::BlackVolTermStructure;
38using QuantLib::Date;
39
40//! Wrapper class for building Equity volatility structures
41/*!
42 \ingroup curves
43*/
45public:
46 //! \name Constructors
47 //@{
48 //! Default constructor
50 //! Detailed constructor
52 const CurveConfigurations& curveConfigs, const QuantLib::Handle<QuantExt::EquityIndex2>& eqIndex,
53 const std::map<std::string, QuantLib::ext::shared_ptr<EquityCurve>>& requiredEquityCurves = {},
54 const std::map<std::string, QuantLib::ext::shared_ptr<EquityVolCurve>>& requiredEquityVolCurves = {},
55 const std::map<std::string, QuantLib::ext::shared_ptr<FXVolCurve>>& requiredFxVolCurves = {},
56 const std::map<std::string, QuantLib::ext::shared_ptr<CorrelationCurve>>& requiredCorrelationCurves = {},
57 const Market* market = nullptr, const bool buildCalibrationInfo = true);
58 //@}
59
60 //! \name Inspectors
61 //@{
62 const EquityVolatilityCurveSpec& spec() const { return spec_; }
63
64 //! Build a volatility structure from a single constant volatility quote
65 void buildVolatility(const QuantLib::Date& asof, const EquityVolatilityCurveConfig& vc,
66 const ConstantVolatilityConfig& cvc, const Loader& loader);
67
68 //! Build a volatility curve from a 1-D curve of volatility quotes
69 void buildVolatility(const QuantLib::Date& asof, const EquityVolatilityCurveConfig& vc,
70 const VolatilityCurveConfig& vcc, const Loader& loader);
71
72 //! Build a volatility surface from a collection of expiry and absolute strike pairs.
73 void buildVolatility(const QuantLib::Date& asof, EquityVolatilityCurveConfig& vc,
74 const VolatilityStrikeSurfaceConfig& vssc, const Loader& loader,
75 const QuantLib::Handle<QuantExt::EquityIndex2>& eqIndex);
76
77 //! Build a volatility surface from a collection of expiry and moneyness strike pairs.
78 void buildVolatility(const QuantLib::Date& asof, EquityVolatilityCurveConfig& vc,
79 const VolatilityMoneynessSurfaceConfig& vmsc, const Loader& loader,
80 const QuantLib::Handle<QuantExt::EquityIndex2>& eqIndex);
81
82 //! Build a volatility surface from a collection of expiry and strike delta pairs
83 void buildVolatility(const QuantLib::Date& asof, EquityVolatilityCurveConfig& vc,
84 const VolatilityDeltaSurfaceConfig& vdsc, const Loader& loader,
85 const QuantLib::Handle<QuantExt::EquityIndex2>& eqIndex);
86
87 //! Build a volatility surface as a proxy from another volatility surface
88 void buildVolatility(const QuantLib::Date& asof, const EquityVolatilityCurveSpec& spec,
90 const map<string, QuantLib::ext::shared_ptr<EquityCurve>>& eqCurves,
91 const map<string, QuantLib::ext::shared_ptr<EquityVolCurve>>& eqVolCurves,
92 const map<string, QuantLib::ext::shared_ptr<FXVolCurve>>& fxVolCurves,
93 const map<string, QuantLib::ext::shared_ptr<CorrelationCurve>>& requiredCorrelationCurves,
94 const Market* fxIndices = nullptr);
95
96 //! Build the calibration info
97 void buildCalibrationInfo(const QuantLib::Date& asof, const CurveConfigurations& curveConfigs,
98 const EquityVolatilityCurveConfig& config, const Handle<QuantExt::EquityIndex2>& eqIndex);
99
100 const QuantLib::ext::shared_ptr<BlackVolTermStructure>& volTermStructure() const { return vol_; }
101 const QuantLib::ext::shared_ptr<FxEqCommVolCalibrationInfo>& calibrationInfo() const { return calibrationInfo_; }
102 //@}
103
104
105private:
107 QuantLib::ext::shared_ptr<BlackVolTermStructure> vol_;
109 QuantLib::Currency currency_;
110 QuantLib::DayCounter dayCounter_;
111 QuantLib::Date maxExpiry_;
112 QuantLib::ext::shared_ptr<VolatilityConfig> volatilityConfig_;
113 QuantLib::ext::shared_ptr<FxEqCommVolCalibrationInfo> calibrationInfo_;
114};
115} // namespace data
116} // namespace ore
Container class for all Curve Configurations.
Wrapper class for building Equity volatility structures.
const QuantLib::ext::shared_ptr< FxEqCommVolCalibrationInfo > & calibrationInfo() const
QuantLib::ext::shared_ptr< VolatilityConfig > volatilityConfig_
void buildCalibrationInfo(const QuantLib::Date &asof, const CurveConfigurations &curveConfigs, const EquityVolatilityCurveConfig &config, const Handle< QuantExt::EquityIndex2 > &eqIndex)
Build the calibration info.
QuantLib::ext::shared_ptr< FxEqCommVolCalibrationInfo > calibrationInfo_
const QuantLib::ext::shared_ptr< BlackVolTermStructure > & volTermStructure() const
QuantLib::Currency currency_
void buildVolatility(const QuantLib::Date &asof, const EquityVolatilityCurveConfig &vc, const VolatilityCurveConfig &vcc, const Loader &loader)
Build a volatility curve from a 1-D curve of volatility quotes.
QuantLib::ext::shared_ptr< BlackVolTermStructure > vol_
EquityVolCurve()
Default constructor.
QuantLib::Calendar calendar_
void buildVolatility(const QuantLib::Date &asof, EquityVolatilityCurveConfig &vc, const VolatilityMoneynessSurfaceConfig &vmsc, const Loader &loader, const QuantLib::Handle< QuantExt::EquityIndex2 > &eqIndex)
Build a volatility surface from a collection of expiry and moneyness strike pairs.
void buildVolatility(const QuantLib::Date &asof, const EquityVolatilityCurveConfig &vc, const ConstantVolatilityConfig &cvc, const Loader &loader)
Build a volatility structure from a single constant volatility quote.
EquityVolCurve(Date asof, EquityVolatilityCurveSpec spec, const Loader &loader, const CurveConfigurations &curveConfigs, const QuantLib::Handle< QuantExt::EquityIndex2 > &eqIndex, const std::map< std::string, QuantLib::ext::shared_ptr< EquityCurve > > &requiredEquityCurves={}, const std::map< std::string, QuantLib::ext::shared_ptr< EquityVolCurve > > &requiredEquityVolCurves={}, const std::map< std::string, QuantLib::ext::shared_ptr< FXVolCurve > > &requiredFxVolCurves={}, const std::map< std::string, QuantLib::ext::shared_ptr< CorrelationCurve > > &requiredCorrelationCurves={}, const Market *market=nullptr, const bool buildCalibrationInfo=true)
Detailed constructor.
const EquityVolatilityCurveSpec & spec() const
EquityVolatilityCurveSpec spec_
QuantLib::DayCounter dayCounter_
void buildVolatility(const QuantLib::Date &asof, EquityVolatilityCurveConfig &vc, const VolatilityStrikeSurfaceConfig &vssc, const Loader &loader, const QuantLib::Handle< QuantExt::EquityIndex2 > &eqIndex)
Build a volatility surface from a collection of expiry and absolute strike pairs.
Equity volatility structure configuration.
Equity Volatility curve description.
Definition: curvespec.hpp:375
Market data loader base class.
Definition: loader.hpp:47
Currency and instrument specific conventions/defaults.
Curve configuration repository.
Curve requirements specification.
Wrapper class for building Equity curves.
Wrapper class for building FX volatility structures.
Market Datum Loader Interface.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
vector< string > curveConfigs