QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
analyticcompoundoptionengine.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) 2009 Dimitri Reiswich
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
20/*! \file analyticcompoundoptionengine.hpp
21 \brief Analytic compound option engines
22*/
23
24#ifndef quantlib_analytic_compound_option_engine_hpp
25#define quantlib_analytic_compound_option_engine_hpp
26
30
31namespace QuantLib {
32
33 //! Pricing engine for compound options using analytical formulae
34 /*! The formulas are taken from "Foreign Exchange Risk",
35 Uwe Wystup, Risk 2002, where closed form Greeks are available.
36 (not available in Haug 2007).
37 Value: Page 84, Greeks: Pages 94-95.
38
39 \test the correctness of the returned value is tested by
40 reproducing results available in literature.
41 */
43 public:
45 ext::shared_ptr<GeneralizedBlackScholesProcess> process);
46 void calculate() const override;
47
48 private:
51 ext::shared_ptr<GeneralizedBlackScholesProcess> process_;
52
53 // helper methods
57
58 Date maturityMother() const;
59 Date maturityDaughter() const;
60
61 Real dPlus() const;
62 Real dMinus() const;
63
64 Real dPlusTau12(Real S) const;
66
67 Real strikeDaughter() const;
68 Real strikeMother() const;
69
70 Real spot() const;
71
73 Real volatilityMother() const;
74
77
80
81 Real typeDaughter() const;
82 Real typeMother() const;
83
84 Real transformX(Real X) const;
85 Real e(Real X) const;
86
90
94
95 ext::shared_ptr<PlainVanillaPayoff> payoffMother() const;
96 ext::shared_ptr<PlainVanillaPayoff> payoffDaughter() const;
97 };
98
99}
100
101#endif
bivariate cumulative normal distribution
Black-Scholes processes.
Pricing engine for compound options using analytical formulae.
ext::shared_ptr< PlainVanillaPayoff > payoffDaughter() const
ext::shared_ptr< PlainVanillaPayoff > payoffMother() const
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
Compound-option engine base class
Cumulative normal distribution function.
Concrete date class.
Definition: date.hpp:125
Normal distribution function.
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real DiscountFactor
discount factor between dates
Definition: types.hpp:66
Compound option on a single asset.
Definition: any.hpp:35