QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
analyticbarrierengine.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) 2000, 2001, 2002, 2003 RiskMap srl
5 Copyright (C) 2002, 2003 Ferdinando Ametrano
6 Copyright (C) 2002, 2003 Sadruddin Rejeb
7 Copyright (C) 2003 Neil Firth
8 Copyright (C) 2007 StatPro Italia srl
9
10 This file is part of QuantLib, a free-software/open-source library
11 for financial quantitative analysts and developers - http://quantlib.org/
12
13 QuantLib is free software: you can redistribute it and/or modify it
14 under the terms of the QuantLib license. You should have received a
15 copy of the license along with this program; if not, please email
16 <quantlib-dev@lists.sf.net>. The license is also available online at
17 <http://quantlib.org/license.shtml>.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the license for more details.
22*/
23
24/*! \file analyticbarrierengine.hpp
25 \brief Analytic barrier option engines
26*/
27
28#ifndef quantlib_analytic_barrier_engine_hpp
29#define quantlib_analytic_barrier_engine_hpp
30
34
35namespace QuantLib {
36
37 //! Pricing engine for barrier options using analytical formulae
38 /*! The formulas are taken from "Option pricing formulas",
39 E.G. Haug, McGraw-Hill, p.69 and following.
40
41 \ingroup barrierengines
42
43 \test the correctness of the returned value is tested by
44 reproducing results available in literature.
45 */
47 public:
48 AnalyticBarrierEngine(ext::shared_ptr<GeneralizedBlackScholesProcess> process);
49 void calculate() const override;
50
51 private:
52 ext::shared_ptr<GeneralizedBlackScholesProcess> process_;
54 // helper methods
55 Real underlying() const;
56 Real strike() const;
57 Volatility volatility() const;
58 Real barrier() const;
59 Real rebate() const;
60 Real stdDeviation() const;
61 Rate riskFreeRate() const;
63 Rate dividendYield() const;
65 Rate mu() const;
66 Real muSigma() const;
67 Real A(Real phi) const;
68 Real B(Real phi) const;
69 Real C(Real eta, Real phi) const;
70 Real D(Real eta, Real phi) const;
71 Real E(Real eta) const;
72 Real F(Real eta) const;
73 };
74
75}
76
77
78#endif
Barrier option on a single asset.
Black-Scholes processes.
Pricing engine for barrier options using analytical formulae.
Real C(Real eta, Real phi) const
CumulativeNormalDistribution f_
Real D(Real eta, Real phi) const
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
Barrier-option engine base class
Cumulative normal distribution function.
QL_REAL Real
real number
Definition: types.hpp:50
Real DiscountFactor
discount factor between dates
Definition: types.hpp:66
Real Volatility
volatility
Definition: types.hpp:78
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35
normal, cumulative and inverse cumulative distributions
Real F
Definition: sabr.cpp:200