QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
vegastressedblackscholesprocess.cpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2010 Michael Heckl
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
21
22namespace QuantLib {
23
25 const Handle<Quote>& x0,
26 const Handle<YieldTermStructure>& dividendTS,
27 const Handle<YieldTermStructure>& riskFreeTS,
28 const Handle<BlackVolTermStructure>& blackVolTS,
29 Time lowerTimeBorderForStressTest,
30 Time upperTimeBorderForStressTest,
31 Real lowerAssetBorderForStressTest,
32 Real upperAssetBorderForStressTest,
33 Real stressLevel,
34 const ext::shared_ptr<discretization>& disc)
35 : GeneralizedBlackScholesProcess(x0, dividendTS, riskFreeTS,
36 blackVolTS, disc),
37 lowerTimeBorderForStressTest_(lowerTimeBorderForStressTest),
38 upperTimeBorderForStressTest_(upperTimeBorderForStressTest),
39 lowerAssetBorderForStressTest_(lowerAssetBorderForStressTest),
40 upperAssetBorderForStressTest_(upperAssetBorderForStressTest),
41 stressLevel_(stressLevel) {}
42
43 // returns the lower time border for the stress test
46 }
47
48 // returns the upper time border for the stress test
51 }
52
53 // returns the lower asset border for the stress test
56 }
57
58 // returns the upper asset border for the stress test
61 }
62
63 // returns the stress Level
65 return stressLevel_;
66 }
67
68
69 // set the lower time border for the stress test
72 update();
73 }
74
75 // set the upper time border for the stress test
78 update();
79 }
80
81 // set the lower asset border for the stress test
84 update();
85 }
86
87 // set the upper asset border for the stress test
90 update();
91 }
92
93 // set the stress Level
95 stressLevel_ = SL;
96 update();
97 }
98
99
100
105 } else {
107 }
108 }
109
110}
Generalized Black-Scholes stochastic process.
Real diffusion(Time t, Real x) const override
Shared handle to an observable.
Definition: handle.hpp:41
Real diffusion(Time t, Real x) const override
returns the diffusion part of the equation, i.e.
VegaStressedBlackScholesProcess(const Handle< Quote > &x0, const Handle< YieldTermStructure > &dividendTS, const Handle< YieldTermStructure > &riskFreeTS, const Handle< BlackVolTermStructure > &blackVolTS, Time lowerTimeBorderForStressTest=0, Time upperTimeBorderForStressTest=1000000, Real lowerAssetBorderForStressTest=0, Real upperAssetBorderForStressTest=1000000, Real stressLevel=0, const ext::shared_ptr< discretization > &d=ext::shared_ptr< discretization >(new EulerDiscretization))
const DefaultType & t
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
Black-Scholes process which supports local vega stress tests.