QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
pricingengines
asian
turnbullwakemanasianengine.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2021 Skandinaviska Enskilda Banken AB (publ)
3
4
This file is part of QuantLib, a free-software/open-source library
5
for financial quantitative analysts and developers - http://quantlib.org/
6
7
QuantLib is free software: you can redistribute it and/or modify it
8
under the terms of the QuantLib license. You should have received a
9
copy of the license along with this program; if not, please email
10
<quantlib-dev@lists.sf.net>. The license is also available online at
11
<http://quantlib.org/license.shtml>.
12
13
This program is distributed in the hope that it will be useful, but WITHOUT
14
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15
FOR A PARTICULAR PURPOSE. See the license for more details.
16
*/
17
18
/*! \file ql/pricingengines/asian/turnbullwakemanasianengine.hpp
19
\brief Turnbull Wakeman moment-matching Asian option Engine
20
\ingroup asianengines
21
*/
22
23
#ifndef quantlib_turnbull_wakeman_asian_engine_hpp
24
#define quantlib_turnbull_wakeman_asian_engine_hpp
25
26
#include <
ql/instruments/asianoption.hpp
>
27
#include <
ql/processes/blackscholesprocess.hpp
>
28
#include <utility>
29
30
namespace
QuantLib
{
31
32
/*! Turnbull Wakeman two moment-matching Asian option Engine
33
Analytical pricing based on the two-moment Turnbull-Wakeman
34
approximation.
35
References: "Commodity Option Pricing", Iain Clark, Wiley, section 2.7.4.
36
"Option Pricing Formulas, Second Edition", E.G. Haug, 2006, pp. 192-202.
37
Some parts of the implementation were modeled after calculations from the
38
CommodityAveragePriceOptionAnalyticalEngine class in Open Source Risk Engine
39
(https://github.com/OpenSourceRisk/Engine).
40
41
\test
42
- the correctness of the returned value is tested by reproducing
43
results in literature with flat as well as upward and downward
44
sloping volatility term structures.
45
- the pricing of trades with guaranteed exercise/OTM is also tested.
46
*/
47
class
TurnbullWakemanAsianEngine
:
public
DiscreteAveragingAsianOption::engine
{
48
public
:
49
explicit
TurnbullWakemanAsianEngine
(ext::shared_ptr<GeneralizedBlackScholesProcess> process)
50
:
process_
(
std
::move(process)) {
51
registerWith
(
process_
);
52
}
53
54
void
calculate
()
const override
;
55
56
private
:
57
ext::shared_ptr<GeneralizedBlackScholesProcess>
process_
;
58
};
59
60
}
61
62
#endif
asianoption.hpp
Asian option on a single asset.
blackscholesprocess.hpp
Black-Scholes processes.
QuantLib::DiscreteAveragingAsianOption::engine
Discrete-averaging Asian engine base class.
Definition:
asianoption.hpp:126
QuantLib::Observer::registerWith
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Definition:
observable.hpp:228
QuantLib::TurnbullWakemanAsianEngine
Definition:
turnbullwakemanasianengine.hpp:47
QuantLib::TurnbullWakemanAsianEngine::TurnbullWakemanAsianEngine
TurnbullWakemanAsianEngine(ext::shared_ptr< GeneralizedBlackScholesProcess > process)
Definition:
turnbullwakemanasianengine.hpp:49
QuantLib::TurnbullWakemanAsianEngine::calculate
void calculate() const override
Definition:
turnbullwakemanasianengine.cpp:24
QuantLib::TurnbullWakemanAsianEngine::process_
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
Definition:
turnbullwakemanasianengine.hpp:57
QuantLib
Definition:
any.hpp:35
std
STL namespace.
Generated by
Doxygen
1.9.5