QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
blackscholescalculator.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 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
24#ifndef quantlib_blackscholescalculator_hpp
25#define quantlib_blackscholescalculator_hpp
26
27#include <ql/pricingengines/blackcalculator.hpp>
28
29namespace QuantLib {
30
33 public:
35 const ext::shared_ptr<StrikedTypePayoff>& payoff,
36 Real spot,
37 DiscountFactor growth,
38 Real stdDev,
39 DiscountFactor discount);
41 Real strike,
42 Real spot,
43 DiscountFactor growth,
44 Real stdDev,
45 DiscountFactor discount);
46 ~BlackScholesCalculator() override = default;
48 Real delta() const;
51 Real elasticity() const;
54 Real gamma() const;
56 Real theta(Time maturity) const;
59 Real thetaPerDay(Time maturity) const;
60 // also un-hide overloads taking a spot
66 protected:
69 };
70
71 // inline
74 }
75
78 }
79
82 }
83
84 inline Real BlackScholesCalculator::theta(Time maturity) const {
85 return BlackCalculator::theta(spot_, maturity);
86 }
87
89 return BlackCalculator::thetaPerDay(spot_, maturity);
90 }
91
92}
93
94#endif
Black 1976 calculator class.
virtual Real delta(Real spot) const
virtual Real gamma(Real spot) const
virtual Real elasticity(Real spot) const
virtual Real thetaPerDay(Real spot, Time maturity) const
virtual Real theta(Real spot, Time maturity) const
Black-Scholes 1973 calculator class.
~BlackScholesCalculator() override=default
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
Definition: any.hpp:35