QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
pricingengines
americanpayoffathit.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) 2004 Ferdinando Ametrano
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 americanpayoffathit.hpp
21
\brief Analytical formulae for american exercise with payoff at hit
22
*/
23
24
#ifndef quantlib_americanpayoffathit_h
25
#define quantlib_americanpayoffathit_h
26
27
#include <
ql/instruments/payoffs.hpp
>
28
29
namespace
QuantLib
{
30
31
//! Analytic formula for American exercise payoff at-hit options
32
/*! \todo calculate greeks */
33
class
AmericanPayoffAtHit
{
34
public
:
35
AmericanPayoffAtHit
(
36
Real
spot,
37
DiscountFactor
discount,
38
DiscountFactor
dividendDiscount,
39
Real
variance
,
40
const
ext::shared_ptr<StrikedTypePayoff>&
payoff
);
41
Real
value
()
const
;
42
Real
delta
()
const
;
43
Real
gamma
()
const
;
44
Real
rho
(
Time
maturity)
const
;
45
private
:
46
Real
spot_
;
47
DiscountFactor
discount_
,
dividendDiscount_
;
48
Real
variance_
;
49
Volatility
stdDev_
;
50
51
Real
strike_
,
K_
,
DKDstrike_
;
52
53
Real
mu_
,
lambda_
,
muPlusLambda_
,
muMinusLambda_
,
log_H_S_
;
54
55
Real
D1_
,
D2_
,
cum_d1_
,
cum_d2_
;
56
57
Real
alpha_
,
beta_
,
DalphaDd1_
,
DbetaDd2_
;
58
59
bool
inTheMoney_
;
60
Real
forward_
,
X_
,
DXDstrike_
;
61
};
62
63
64
// inline definitions
65
66
inline
Real
AmericanPayoffAtHit::value
()
const
{
67
return
K_
* (
forward_
*
alpha_
+
X_
*
beta_
);
68
}
69
70
}
71
72
73
#endif
QuantLib::AmericanPayoffAtHit
Analytic formula for American exercise payoff at-hit options.
Definition:
americanpayoffathit.hpp:33
QuantLib::AmericanPayoffAtHit::muPlusLambda_
Real muPlusLambda_
Definition:
americanpayoffathit.hpp:53
QuantLib::AmericanPayoffAtHit::discount_
DiscountFactor discount_
Definition:
americanpayoffathit.hpp:47
QuantLib::AmericanPayoffAtHit::DalphaDd1_
Real DalphaDd1_
Definition:
americanpayoffathit.hpp:57
QuantLib::AmericanPayoffAtHit::variance_
Real variance_
Definition:
americanpayoffathit.hpp:48
QuantLib::AmericanPayoffAtHit::mu_
Real mu_
Definition:
americanpayoffathit.hpp:53
QuantLib::AmericanPayoffAtHit::delta
Real delta() const
Definition:
americanpayoffathit.cpp:160
QuantLib::AmericanPayoffAtHit::cum_d2_
Real cum_d2_
Definition:
americanpayoffathit.hpp:55
QuantLib::AmericanPayoffAtHit::log_H_S_
Real log_H_S_
Definition:
americanpayoffathit.hpp:53
QuantLib::AmericanPayoffAtHit::DXDstrike_
Real DXDstrike_
Definition:
americanpayoffathit.hpp:60
QuantLib::AmericanPayoffAtHit::X_
Real X_
Definition:
americanpayoffathit.hpp:60
QuantLib::AmericanPayoffAtHit::lambda_
Real lambda_
Definition:
americanpayoffathit.hpp:53
QuantLib::AmericanPayoffAtHit::forward_
Real forward_
Definition:
americanpayoffathit.hpp:60
QuantLib::AmericanPayoffAtHit::K_
Real K_
Definition:
americanpayoffathit.hpp:51
QuantLib::AmericanPayoffAtHit::beta_
Real beta_
Definition:
americanpayoffathit.hpp:57
QuantLib::AmericanPayoffAtHit::muMinusLambda_
Real muMinusLambda_
Definition:
americanpayoffathit.hpp:53
QuantLib::AmericanPayoffAtHit::value
Real value() const
Definition:
americanpayoffathit.hpp:66
QuantLib::AmericanPayoffAtHit::alpha_
Real alpha_
Definition:
americanpayoffathit.hpp:57
QuantLib::AmericanPayoffAtHit::inTheMoney_
bool inTheMoney_
Definition:
americanpayoffathit.hpp:59
QuantLib::AmericanPayoffAtHit::gamma
Real gamma() const
Definition:
americanpayoffathit.cpp:181
QuantLib::AmericanPayoffAtHit::dividendDiscount_
DiscountFactor dividendDiscount_
Definition:
americanpayoffathit.hpp:47
QuantLib::AmericanPayoffAtHit::DKDstrike_
Real DKDstrike_
Definition:
americanpayoffathit.hpp:51
QuantLib::AmericanPayoffAtHit::cum_d1_
Real cum_d1_
Definition:
americanpayoffathit.hpp:55
QuantLib::AmericanPayoffAtHit::spot_
Real spot_
Definition:
americanpayoffathit.hpp:46
QuantLib::AmericanPayoffAtHit::stdDev_
Volatility stdDev_
Definition:
americanpayoffathit.hpp:49
QuantLib::AmericanPayoffAtHit::D1_
Real D1_
Definition:
americanpayoffathit.hpp:55
QuantLib::AmericanPayoffAtHit::DbetaDd2_
Real DbetaDd2_
Definition:
americanpayoffathit.hpp:57
QuantLib::AmericanPayoffAtHit::D2_
Real D2_
Definition:
americanpayoffathit.hpp:55
QuantLib::AmericanPayoffAtHit::strike_
Real strike_
Definition:
americanpayoffathit.hpp:51
variance
LinearInterpolation variance
Definition:
fdmhestonvariancemesher.cpp:45
QuantLib::Time
Real Time
continuous quantity with 1-year units
Definition:
types.hpp:62
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib::DiscountFactor
Real DiscountFactor
discount factor between dates
Definition:
types.hpp:66
QuantLib::Volatility
Real Volatility
volatility
Definition:
types.hpp:78
rho
Real rho
Definition:
hestonrndcalculator.cpp:36
payoff
ext::shared_ptr< QuantLib::Payoff > payoff
Definition:
integralhestonvarianceoptionengine.cpp:350
QuantLib
Definition:
any.hpp:35
payoffs.hpp
Payoffs for various options.
Generated by
Doxygen
1.9.5