Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fdmquantohelper.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 fdmquantohelper.hpp
20 \brief extended version of the QuantLib class, see the documentation for details
21*/
22
23#pragma once
24
25#include <ql/math/array.hpp>
26#include <ql/patterns/observable.hpp>
27
28namespace QuantLib {
29class YieldTermStructure;
31} // namespace QuantLib
32
33namespace QuantExt {
34using namespace QuantLib;
35
36/*! As the ql class, but fxStrike can be null in which case the atmf level is used as a strike, more precisely
37 we compute
38
39 forward vol = sqrt( ( V(t2, k2) - V(t1, k1) ) / (t2-t1) )
40
41 where k1, k2 are the atmf levels at t1 and t2. If fxStrike = null, the initialFxSpot value must be given.
42
43 If discounting = false, the adjustment will omit the rTS and fTS terms.
44
45 If ensureNonNegativeForwardVariance is true, the forward variances from the input vol ts are floored at zero. */
46class FdmQuantoHelper : public Observable {
47public:
48 FdmQuantoHelper(const ext::shared_ptr<YieldTermStructure>& rTS, const ext::shared_ptr<YieldTermStructure>& fTS,
49 const ext::shared_ptr<BlackVolTermStructure>& fxVolTS, const Real equityFxCorrelation,
50 const Real fxStrike, Real initialFxSpot = Null<Real>(), const bool discounting = true,
51 const bool ensureNonNegativeForwardVariance = false);
52
53 Rate quantoAdjustment(Volatility equityVol, Time t1, Time t2) const;
54 Array quantoAdjustment(const Array& equityVol, Time t1, Time t2) const;
55
56private:
57 const ext::shared_ptr<YieldTermStructure> rTS_, fTS_;
58 const ext::shared_ptr<BlackVolTermStructure> fxVolTS_;
61};
62
63} // namespace QuantExt
const bool ensureNonNegativeForwardVariance_
const ext::shared_ptr< YieldTermStructure > fTS_
const ext::shared_ptr< BlackVolTermStructure > fxVolTS_
const ext::shared_ptr< YieldTermStructure > rTS_
Rate quantoAdjustment(Volatility equityVol, Time t1, Time t2) const