Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
blackvolconstantspread.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 qle/termstructures/blackvolconstantspread.hpp
20 \brief surface that combines an ATM curve and vol spreads from a surface
21 \ingroup termstructures
22*/
23
24#ifndef quantext_blackvolatilityconstantspread_hpp
25#define quantext_blackvolatilityconstantspread_hpp
26
27#include <ql/shared_ptr.hpp>
28#include <ql/termstructures/volatility/equityfx/blackvariancecurve.hpp>
29#include <ql/termstructures/volatility/equityfx/blackvariancesurface.hpp>
30#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
31
32namespace QuantExt {
33using namespace QuantLib;
34
35//! Cube that combines an ATM matrix and vol spreads from a cube
36/*! Notice that the TS has a floating reference date and accesses the source TS only via
37 their time-based volatility methods.
38
39 \warning the given atm vol structure should be strike independent, this is not checked
40*/
42public:
43 BlackVolatilityConstantSpread(const Handle<BlackVolTermStructure>& atm,
44 const Handle<BlackVolTermStructure>& surface);
45
46 //! \name TermStructure interface
47 //@{
48 DayCounter dayCounter() const override;
49 Date maxDate() const override;
50 Time maxTime() const override;
51 const Date& referenceDate() const override;
52 Calendar calendar() const override;
53 Natural settlementDays() const override;
54 //@}
55 //! \name VolatilityTermStructure interface
56 //@{
57 Rate minStrike() const override;
58 Rate maxStrike() const override;
59 //@}
60
61 // override Termstructure deepUpdate to ensure atm_ curve is updatesd
62 void deepUpdate() override;
63
64protected:
65 Volatility blackVolImpl(Time t, Rate strike) const override;
66 Real blackVarianceImpl(Time t, Real strike) const override;
67
68private:
69 Handle<BlackVolTermStructure> atm_, surface_;
70};
71
72} // namespace QuantExt
73
74#endif
Cube that combines an ATM matrix and vol spreads from a cube.
Handle< BlackVolTermStructure > surface_
Real blackVarianceImpl(Time t, Real strike) const override
Volatility blackVolImpl(Time t, Rate strike) const override