QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
analyticdigitalamericanengine.hpp
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) 2003, 2004 Ferdinando Ametrano
5 Copyright (C) 2003, 2004, 2007 StatPro Italia srl
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21/*! \file analyticdigitalamericanengine.hpp
22 \brief analytic digital American option engine
23*/
24
25#ifndef quantlib_analytic_digital_american_engine_hpp
26#define quantlib_analytic_digital_american_engine_hpp
27
30
31namespace QuantLib {
32
33 //! Analytic pricing engine for American vanilla options with digital payoff
34 /*! \ingroup vanillaengines
35
36 \todo add more greeks (as of now only delta and rho available)
37
38 \test
39 - the correctness of the returned value in case of
40 cash-or-nothing at-hit digital payoff is tested by
41 reproducing results available in literature.
42 - the correctness of the returned value in case of
43 asset-or-nothing at-hit digital payoff is tested by
44 reproducing results available in literature.
45 - the correctness of the returned value in case of
46 cash-or-nothing at-expiry digital payoff is tested by
47 reproducing results available in literature.
48 - the correctness of the returned value in case of
49 asset-or-nothing at-expiry digital payoff is tested by
50 reproducing results available in literature.
51 - the correctness of the returned greeks in case of
52 cash-or-nothing at-hit digital payoff is tested by
53 reproducing numerical derivatives.
54 */
56 public:
57 AnalyticDigitalAmericanEngine(ext::shared_ptr<GeneralizedBlackScholesProcess>);
58 void calculate() const override;
59 virtual bool knock_in() const {
60 return true;
61 }
62 private:
63 ext::shared_ptr<GeneralizedBlackScholesProcess> process_;
64 };
65
66 //! Analytic pricing engine for American Knock-out options with digital payoff
67 /*! \ingroup vanillaengines
68
69 \todo add more greeks (as of now only delta and rho available)
70
71 \test
72 - the correctness of the returned value in case of
73 cash-or-nothing at-hit digital payoff is tested by
74 reproducing results available in literature.
75 - the correctness of the returned value in case of
76 asset-or-nothing at-hit digital payoff is tested by
77 reproducing results available in literature.
78 - the correctness of the returned value in case of
79 cash-or-nothing at-expiry digital payoff is tested by
80 reproducing results available in literature.
81 - the correctness of the returned value in case of
82 asset-or-nothing at-expiry digital payoff is tested by
83 reproducing results available in literature.
84 - the correctness of the returned greeks in case of
85 cash-or-nothing at-hit digital payoff is tested by
86 reproducing numerical derivatives.
87 */
90 public:
92 const ext::shared_ptr<GeneralizedBlackScholesProcess>
93 &engine):
95 bool knock_in() const override { return false; }
96 };
97
98}
99
100
101#endif
Black-Scholes processes.
Analytic pricing engine for American vanilla options with digital payoff.
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
Analytic pricing engine for American Knock-out options with digital payoff.
AnalyticDigitalAmericanKOEngine(const ext::shared_ptr< GeneralizedBlackScholesProcess > &engine)
Definition: any.hpp:35
Vanilla option on a single asset.