QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
blackformula.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2001, 2002, 2003 Sadruddin Rejeb
5 Copyright (C) 2003, 2004, 2005, 2006, 2008 Ferdinando Ametrano
6 Copyright (C) 2006 Mark Joshi
7 Copyright (C) 2006 StatPro Italia srl
8 Copyright (C) 2007 Cristina Duminuco
9 Copyright (C) 2007 Chiara Fornarola
10 Copyright (C) 2013 Gary Kennedy
11 Copyright (C) 2015 Peter Caspers
12 Copyright (C) 2017 Klaus Spanderen
13 Copyright (C) 2019 Wojciech Ĺšlusarski
14 Copyright (C) 2020 Marcin Rybacki
15
16 This file is part of QuantLib, a free-software/open-source library
17 for financial quantitative analysts and developers - http://quantlib.org/
18
19 QuantLib is free software: you can redistribute it and/or modify it
20 under the terms of the QuantLib license. You should have received a
21 copy of the license along with this program; if not, please email
22 <quantlib-dev@lists.sf.net>. The license is also available online at
23 <http://quantlib.org/license.shtml>.
24
25 This program is distributed in the hope that it will be useful, but WITHOUT
26 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
27 FOR A PARTICULAR PURPOSE. See the license for more details.
28*/
29
34#ifndef quantlib_blackformula_hpp
35#define quantlib_blackformula_hpp
36
37#include <ql/instruments/payoffs.hpp>
38#include <ql/option.hpp>
39
40namespace QuantLib {
41
47 Real strike,
48 Real forward,
49 Real stdDev,
50 Real discount = 1.0,
51 Real displacement = 0.0);
52
57 Real blackFormula(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
58 Real forward,
59 Real stdDev,
60 Real discount = 1.0,
61 Real displacement = 0.0);
62
68 Real strike,
69 Real forward,
70 Real stdDev,
71 Real discount = 1.0,
72 Real displacement = 0.0);
73
78 Real blackFormulaForwardDerivative(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
79 Real forward,
80 Real stdDev,
81 Real discount = 1.0,
82 Real displacement = 0.0);
83
92 Real strike,
93 Real forward,
94 Real blackPrice,
95 Real discount = 1.0,
96 Real displacement = 0.0);
97
105 Real blackFormulaImpliedStdDevApproximation(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
106 Real forward,
107 Real blackPrice,
108 Real discount = 1.0,
109 Real displacement = 0.0);
110
120 Real strike,
121 Real forward,
122 Real blackPrice,
123 Real blackAtmPrice,
124 Real discount = 1.0,
125 Real displacement = 0.0);
126
135 Real blackFormulaImpliedStdDevChambers(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
136 Real forward,
137 Real blackPrice,
138 Real blackAtmPrice,
139 Real discount = 1.0,
140 Real displacement = 0.0);
141
156 Real strike,
157 Real forward,
158 Real blackPrice,
159 Real discount = 1.0,
160 Real displacement = 0.0);
161
162 Real blackFormulaImpliedStdDevApproximationRS(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
163 Real forward,
164 Real blackPrice,
165 Real discount = 1.0,
166 Real displacement = 0.0);
167
168
173 Real strike,
174 Real forward,
175 Real blackPrice,
176 Real discount = 1.0,
177 Real displacement = 0.0,
178 Real guess = Null<Real>(),
179 Real accuracy = 1.0e-6,
180 Natural maxIterations = 100);
181
185 Real blackFormulaImpliedStdDev(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
186 Real forward,
187 Real blackPrice,
188 Real discount = 1.0,
189 Real displacement = 0.0,
190 Real guess = Null<Real>(),
191 Real accuracy = 1.0e-6,
192 Natural maxIterations = 100);
193
209 Real strike,
210 Real forward,
211 Real blackPrice,
212 Real discount = 1.0,
213 Real displacement = 0.0,
214 Real guess = Null<Real>(),
215 Real omega = 1.0,
216 Real accuracy = 1.0e-6,
217 Natural maxIterations = 100);
218
219 Real blackFormulaImpliedStdDevLiRS(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
220 Real forward,
221 Real blackPrice,
222 Real discount = 1.0,
223 Real displacement = 0.0,
224 Real guess = Null<Real>(),
225 Real omega = 1.0,
226 Real accuracy = 1.0e-6,
227 Natural maxIterations = 100);
228
236 Option::Type optionType, Real strike, Real forward, Real stdDev, Real displacement = 0.0);
237
244 Real blackFormulaCashItmProbability(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
245 Real forward,
246 Real stdDev,
247 Real displacement = 0.0);
248
254 Option::Type optionType, Real strike, Real forward, Real stdDev, Real displacement = 0.0);
255
260 Real blackFormulaAssetItmProbability(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
261 Real forward,
262 Real stdDev,
263 Real displacement = 0.0);
264
273 Real strike, Real forward, Real stdDev, Real discount = 1.0, Real displacement = 0.0);
274
279 Real forward,
280 Real stdDev,
281 Real expiry,
282 Real discount = 1.0,
283 Real displacement = 0.0);
284
285
293 Real blackFormulaStdDevDerivative(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
294 Real forward,
295 Real stdDev,
296 Real discount = 1.0,
297 Real displacement = 0.0);
298
305 Rate strike, Rate forward, Real stdDev, Real discount, Real displacement);
306
312 Real blackFormulaStdDevSecondDerivative(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
313 Real forward,
314 Real stdDev,
315 Real discount = 1.0,
316 Real displacement = 0.0);
317
326 Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount = 1.0);
327
335 Real bachelierBlackFormula(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
336 Real forward,
337 Real stdDev,
338 Real discount = 1.0);
339
347 Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount = 1.0);
348
356 const ext::shared_ptr<PlainVanillaPayoff>& payoff,
357 Real forward,
358 Real stdDev,
359 Real discount = 1.0);
360
369 Real strike,
370 Real forward,
371 Real tte,
372 Real bachelierPrice,
373 Real discount = 1.0);
374
384 Real forward,
385 Real stdDev,
386 Real discount = 1.0);
387
388 Real bachelierBlackFormulaStdDevDerivative(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
389 Real forward,
390 Real stdDev,
391 Real discount = 1.0);
392
398 Real strike,
399 Real forward,
400 Real stdDev);
401
406 Real bachelierBlackFormulaAssetItmProbability(const ext::shared_ptr<PlainVanillaPayoff>& payoff,
407 Real forward,
408 Real stdDev);
409
410}
411
412#endif
QL_REAL Real
real number
Definition: types.hpp:50
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35
Real blackFormulaAssetItmProbability(Option::Type optionType, Real strike, Real forward, Real stdDev, Real displacement)
Real blackFormulaCashItmProbability(Option::Type optionType, Real strike, Real forward, Real stdDev, Real displacement)
Real blackFormulaImpliedStdDevLiRS(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real discount, Real displacement, Real guess, Real w, Real accuracy, Natural maxIterations)
Real blackFormulaImpliedStdDevChambers(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real blackAtmPrice, Real discount, Real displacement)
Real bachelierBlackFormulaAssetItmProbability(Option::Type optionType, Real strike, Real forward, Real stdDev)
Real bachelierBlackFormulaStdDevDerivative(Rate strike, Rate forward, Real stdDev, Real discount)
Real bachelierBlackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount)
Real blackFormulaImpliedStdDev(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real discount, Real displacement, Real guess, Real accuracy, Natural maxIterations)
Real blackFormulaForwardDerivative(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount, Real displacement)
Real bachelierBlackFormulaForwardDerivative(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount)
Real blackFormulaVolDerivative(Rate strike, Rate forward, Real stdDev, Real expiry, Real discount, Real displacement)
Real blackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount, Real displacement)
Real bachelierBlackFormulaImpliedVol(Option::Type optionType, Real strike, Real forward, Real tte, Real bachelierPrice, Real discount)
Real blackFormulaStdDevSecondDerivative(Rate strike, Rate forward, Real stdDev, Real discount, Real displacement)
Real blackFormulaImpliedStdDevApproximation(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real discount, Real displacement)
Real blackFormulaImpliedStdDevApproximationRS(Option::Type type, Real K, Real F, Real marketValue, Real df, Real displacement)
Real blackFormulaStdDevDerivative(Rate strike, Rate forward, Real stdDev, Real discount, Real displacement)