Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
crossassetmodelimpliedeqvoltermstructure.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 qle/models/crossassetmodelimpliedeqvoltermstructure.hpp
20 \brief dynamic black volatility term structure
21 \ingroup crossassetmodel
22*/
23
24#ifndef quantext_crossassetmodel_implied_eq_volatility_termstructure_hpp
25#define quantext_crossassetmodel_implied_eq_volatility_termstructure_hpp
26
28
29#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
30
31namespace QuantExt {
32using namespace QuantLib;
33
34//! Analytic Cross-Asset LGM Equity Option Engine
35/*! \ingroup crossassetmodel
36 */
37class AnalyticXAssetLgmEquityOptionEngine;
38
39//! Cross Asset Model Implied EQ Term Structure
40/*! The termstructure as the reference date of the model at construction,
41 you can vary this and the relevant state variables using the state() and
42 move() methods.
43
44 \ingroup crossassetmodel
45*/
46
48public:
49 CrossAssetModelImpliedEqVolTermStructure(const QuantLib::ext::shared_ptr<CrossAssetModel>& model, const Size equityIndex,
50 BusinessDayConvention bdc = Following, const DayCounter& dc = DayCounter(),
51 const bool purelyTimeBased = false);
52
53 void referenceDate(const Date& d);
54 void referenceTime(const Time t);
55 void state(const Real eqIr, const Real logEq);
56 void move(const Date& d, const Real eqIr, const Real logEq);
57 void move(const Time t, const Real eqIr, const Real logEq);
58
59 /* VolatilityTermStructure interface */
60 Real minStrike() const override;
61 Real maxStrike() const override;
62 /* TermStructure interface */
63 Date maxDate() const override;
64 Time maxTime() const override;
65 const Date& referenceDate() const override;
66 /* Observer interface */
67 void update() override;
68
69 Size equityIndex() const { return eqIndex_; }
70 Size eqCcyIndex() const { return model_->ccyIndex(model_->eqbs(eqIndex_)->currency()); }
71
72protected:
73 /* BlackVolTermStructure interface */
74 Real blackVarianceImpl(Time t, Real strike) const override;
75 Volatility blackVolImpl(Time t, Real strike) const override;
76
77private:
78 const QuantLib::ext::shared_ptr<CrossAssetModel> model_;
79 const Size eqIndex_;
80 const bool purelyTimeBased_;
81 const QuantLib::ext::shared_ptr<AnalyticXAssetLgmEquityOptionEngine> engine_;
84};
85
86} // namespace QuantExt
87
88#endif
void move(const Date &d, const Real eqIr, const Real logEq)
const QuantLib::ext::shared_ptr< AnalyticXAssetLgmEquityOptionEngine > engine_
cross asset model