Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
cdsvolcurve.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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/cdsvolcurve.hpp
20 \brief Class for building cds volatility structures.
21 \ingroup curves
22*/
23
24#pragma once
25
31
32namespace ore {
33namespace data {
34
35/*! Class for building CDS option volatility structures
36 \ingroup curves
37*/
39public:
40 //! \name Constructors
41 //@{
42 //! Default constructor
44
45 //! Detailed constructor
46 CDSVolCurve(QuantLib::Date asof, CDSVolatilityCurveSpec spec, const Loader& loader,
48 const std::map<std::string, QuantLib::ext::shared_ptr<CDSVolCurve>>& requiredCdsVolCurves = {},
49 const std::map<std::string, QuantLib::ext::shared_ptr<DefaultCurve>>& requiredCdsCurves = {});
50 //@}
51
52 //! \name Inspectors
53 //@{
54 const CDSVolatilityCurveSpec& spec() const { return spec_; }
55 const QuantLib::ext::shared_ptr<QuantExt::CreditVolCurve>& volTermStructure() { return vol_; }
56 //@}
57
58private:
60 QuantLib::ext::shared_ptr<QuantExt::CreditVolCurve> vol_;
62 QuantLib::DayCounter dayCounter_;
64
65 //! Build a volatility structure from a single constant volatility quote
66 void buildVolatility(const QuantLib::Date& asof, const CDSVolatilityCurveConfig& vc,
67 const ConstantVolatilityConfig& cvc, const Loader& loader);
68
69 //! Build a volatility curve from a 1-D curve of volatility quotes
70 void buildVolatility(const QuantLib::Date& asof, const CDSVolatilityCurveConfig& vc,
71 const VolatilityCurveConfig& vcc, const Loader& loader);
72
73 //! Build a volatility surface from a collection of expiry and absolute strike pairs.
74 void buildVolatility(const QuantLib::Date& asof, CDSVolatilityCurveConfig& vc,
75 const VolatilityStrikeSurfaceConfig& vssc, const Loader& loader,
76 const std::map<std::string, QuantLib::ext::shared_ptr<DefaultCurve>>& requiredCdsCurves);
77
78 void buildVolatility(const Date& asof, const CDSVolatilityCurveSpec& spec, const CDSVolatilityCurveConfig& vc,
79 const CDSProxyVolatilityConfig& pvc,
80 const std::map<std::string, QuantLib::ext::shared_ptr<CDSVolCurve>>& requiredCdsVolCurves,
81 const std::map<std::string, QuantLib::ext::shared_ptr<DefaultCurve>>& requiredCdsCurves);
82
83 /*! Build a volatility surface from a collection of expiry and absolute strike pairs where the strikes and
84 expiries are both explicitly configured i.e. where wild cards are not used for either the strikes or
85 the expiries.
86 */
87 void buildVolatilityExplicit(const QuantLib::Date& asof, CDSVolatilityCurveConfig& vc,
88 const VolatilityStrikeSurfaceConfig& vssc, const Loader& loader,
89 const std::vector<QuantLib::Real>& configuredStrikes,
90 const std::map<std::string, QuantLib::ext::shared_ptr<DefaultCurve>>& requiredCdsCurves);
91
92 //! Get an explicit expiry date from a CDS option quote's Expiry
93 QuantLib::Date getExpiry(const QuantLib::Date& asof, const QuantLib::ext::shared_ptr<Expiry>& expiry) const;
94};
95
96} // namespace data
97} // namespace ore
CDSVolCurve()
Default constructor.
Definition: cdsvolcurve.hpp:43
QuantLib::Date getExpiry(const QuantLib::Date &asof, const QuantLib::ext::shared_ptr< Expiry > &expiry) const
Get an explicit expiry date from a CDS option quote's Expiry.
QuantExt::CreditVolCurve::Type strikeType_
Definition: cdsvolcurve.hpp:63
CDSVolCurve(QuantLib::Date asof, CDSVolatilityCurveSpec spec, const Loader &loader, const CurveConfigurations &curveConfigs, const std::map< std::string, QuantLib::ext::shared_ptr< CDSVolCurve > > &requiredCdsVolCurves={}, const std::map< std::string, QuantLib::ext::shared_ptr< DefaultCurve > > &requiredCdsCurves={})
Detailed constructor.
void buildVolatility(const QuantLib::Date &asof, CDSVolatilityCurveConfig &vc, const VolatilityStrikeSurfaceConfig &vssc, const Loader &loader, const std::map< std::string, QuantLib::ext::shared_ptr< DefaultCurve > > &requiredCdsCurves)
Build a volatility surface from a collection of expiry and absolute strike pairs.
QuantLib::Calendar calendar_
Definition: cdsvolcurve.hpp:61
QuantLib::ext::shared_ptr< QuantExt::CreditVolCurve > vol_
Definition: cdsvolcurve.hpp:60
CDSVolatilityCurveSpec spec_
Definition: cdsvolcurve.hpp:59
const QuantLib::ext::shared_ptr< QuantExt::CreditVolCurve > & volTermStructure()
Definition: cdsvolcurve.hpp:55
void buildVolatilityExplicit(const QuantLib::Date &asof, CDSVolatilityCurveConfig &vc, const VolatilityStrikeSurfaceConfig &vssc, const Loader &loader, const std::vector< QuantLib::Real > &configuredStrikes, const std::map< std::string, QuantLib::ext::shared_ptr< DefaultCurve > > &requiredCdsCurves)
const CDSVolatilityCurveSpec & spec() const
Definition: cdsvolcurve.hpp:54
QuantLib::DayCounter dayCounter_
Definition: cdsvolcurve.hpp:62
void buildVolatility(const QuantLib::Date &asof, const CDSVolatilityCurveConfig &vc, const ConstantVolatilityConfig &cvc, const Loader &loader)
Build a volatility structure from a single constant volatility quote.
CDS Volatility curve description.
Definition: curvespec.hpp:156
Container class for all Curve Configurations.
Market data loader base class.
Definition: loader.hpp:47
Currency and instrument specific conventions/defaults.
Curve configuration repository.
Wrapper class for building Default curves.
Market Datum Loader Interface.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
vector< string > curveConfigs