QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
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
28
29namespace QuantLib {
30
31 //! Analytic formula for American exercise payoff at-hit options
32 /*! \todo calculate greeks */
34 public:
36 Real spot,
37 DiscountFactor discount,
38 DiscountFactor dividendDiscount,
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:
50
52
54
56
58
61 };
62
63
64 // inline definitions
65
67 return K_ * (forward_ * alpha_ + X_ * beta_);
68 }
69
70}
71
72
73#endif
Analytic formula for American exercise payoff at-hit options.
LinearInterpolation variance
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
Real Volatility
volatility
Definition: types.hpp:78
Real rho
ext::shared_ptr< QuantLib::Payoff > payoff
Definition: any.hpp:35
Payoffs for various options.