Finance
BlackScholesGamma
compute the Gamma of a European-style option with given payoff
Calling Sequence
Parameters
Description
Examples
References
Compatibility
BlackScholesGamma(S0, K, T, sigma, r, d, optiontype)
BlackScholesGamma(S0, P, T, sigma, r, d)
S0
-
algebraic expression; initial (current) value of the underlying asset
K
algebraic expression; strike price
T
algebraic expression; time to maturity
sigma
algebraic expression; volatility
r
algebraic expression; continuously compounded risk-free rate
d
algebraic expression; continuously compounded dividend yield
P
operator or procedure; payoff function
optiontype
call or put; option type
The Gamma of an option or a portfolio of options is the sensitivity of the Delta to changes in the value of the underlying asset
Gamma=ⅆ2SⅆS02
The BlackScholesGamma command computes the Gamma of a European-style option with the specified payoff function.
The parameter S0 is the initial (current) value of the underlying asset. The parameter T is the time to maturity in years.
The parameter K specifies the strike price if this is a vanilla put or call option. Any payoff function can be specified using the second calling sequence. In this case the parameter P must be given in the form of an operator, which accepts one parameter (spot price at maturity) and returns the corresponding payoff.
The sigma, r, and d parameters are the volatility, the risk-free rate, and the dividend yield of the underlying asset. These parameters can be given in either the algebraic form or the operator form. The parameter d is optional. By default, the dividend yield is taken to be 0.
with⁡Finance:
First you compute the Gamma of a European call option with strike price 100, which matures in 1 year. This will define the Gamma as a function of the risk-free rate, the dividend yield, and the volatility.
BlackScholesGamma⁡100,100,1,σ,r,d,call
2⁢ⅇ−σ4+4⁢d⁢σ2+4⁢r⁢σ2+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2200⁢σ⁢π
In this example you will use numeric values for the risk-free rate, the dividend yield, and the volatility.
BlackScholesGamma⁡100,100,1,0.3,0.05,0.03,call
0.01260567542
You can also use the generic method in which the option is defined through its payoff function.
BlackScholesGamma⁡100,t↦max⁡t−100,0,1,σ,r,d
BlackScholesGamma⁡100,t↦max⁡t−100,0,1,0.3,0.05,0.03
0.01260567513
BSGamma≔expand⁡BlackScholesGamma⁡100,100,1,σ,r,0.03,call
BSGamma≔0.001965014020⁢ⅇ−0.1249999999⁢σ2⁢ⅇ−0.4999999997⁢r⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.0004499999997σ2σ+0.0001179008410⁢ⅇ−0.1249999999⁢σ2⁢ⅇ−0.4999999997⁢r⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.0004499999997σ2σ3−0.003930028034⁢r⁢ⅇ−0.1249999999⁢σ2⁢ⅇ−0.4999999997⁢r⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.0004499999997σ2σ3−0.0001179008410⁢ⅇ−0.5000000002⁢r⁢ⅇ−0.0004499999998σ2⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ−0.1249999999⁢σ2σ3+0.003930028033⁢r⁢ⅇ−0.5000000002⁢r⁢ⅇ−0.0004499999998σ2⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ−0.1249999999⁢σ2σ3+0.001965014018⁢ⅇ−0.5000000002⁢r⁢ⅇ−0.0004499999998σ2⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ−0.1249999999⁢σ2σ
plot3d⁡BSGamma,σ=0..1,r=0..1,axes=BOXED
Here are similar examples for the European put option.
BlackScholesGamma⁡100,50,1,σ,r,d,put
2d−rσ2⁢ⅇ−σ4+4⁢d⁢σ2+4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2200⁢σ⁢π
BlackScholesGamma⁡100,50,1,0.3,0.05,0.03,put
0.000529595076
BlackScholesGamma⁡100,t↦max⁡50−t,0,1,σ,r,d
ⅇ−r⁢2⁢2σ2+2⁢d−2⁢r2⁢σ2⁢σ2⁢ⅇ−σ4+4⁢d⁢σ2−4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2−23⁢σ2+2⁢d−2⁢r2⁢σ2⁢ln⁡2⁢ⅇ−σ4+4⁢d⁢σ2−4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2+23⁢σ2+2⁢d−2⁢r2⁢σ2⁢d⁢ⅇ−σ4+4⁢d⁢σ2−4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2−23⁢σ2+2⁢d−2⁢r2⁢σ2⁢r⁢ⅇ−σ4+4⁢d⁢σ2−4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2+ⅇ−−σ2+2⁢ln⁡2−2⁢d+2⁢r28⁢σ2⁢σ2+2⁢ln⁡2⁢ⅇ−−σ2+2⁢ln⁡2−2⁢d+2⁢r28⁢σ2−2⁢ⅇ−−σ2+2⁢ln⁡2−2⁢d+2⁢r28⁢σ2⁢d+2⁢ⅇ−−σ2+2⁢ln⁡2−2⁢d+2⁢r28⁢σ2⁢r800⁢π⁢σ3
BlackScholesGamma⁡100,t↦max⁡50−t,0,1,0.3,0.05,0.03,d
0.0005295950875
In this example, you will compute the Gamma of a strangle.
S≔BlackScholesGamma⁡100,t↦piecewise⁡t<50,50−t,t<100,0,t−100,1,σ,r,d
S≔ⅇ−r⁢2⁢2σ2+2⁢d−2⁢r2⁢σ2⁢σ2⁢ⅇ−σ4+4⁢d⁢σ2−4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2−23⁢σ2+2⁢d−2⁢r2⁢σ2⁢ln⁡2⁢ⅇ−σ4+4⁢d⁢σ2−4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2+23⁢σ2+2⁢d−2⁢r2⁢σ2⁢d⁢ⅇ−σ4+4⁢d⁢σ2−4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2−23⁢σ2+2⁢d−2⁢r2⁢σ2⁢r⁢ⅇ−σ4+4⁢d⁢σ2−4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2+ⅇ−−σ2+2⁢ln⁡2−2⁢d+2⁢r28⁢σ2⁢σ2+4⁢ⅇ−σ2+2⁢d−2⁢r28⁢σ2⁢σ2+2⁢ln⁡2⁢ⅇ−−σ2+2⁢ln⁡2−2⁢d+2⁢r28⁢σ2−2⁢ⅇ−−σ2+2⁢ln⁡2−2⁢d+2⁢r28⁢σ2⁢d+2⁢ⅇ−−σ2+2⁢ln⁡2−2⁢d+2⁢r28⁢σ2⁢r800⁢π⁢σ3
C≔BlackScholesGamma⁡100,100,1,σ,r,d,call
C≔2⁢ⅇ−σ4+4⁢d⁢σ2+4⁢r⁢σ2+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2200⁢σ⁢π
P≔BlackScholesGamma⁡100,50,1,σ,r,d,put
P≔2d−rσ2⁢ⅇ−σ4+4⁢d⁢σ2+4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2200⁢σ⁢π
Check:
expand⁡simplify⁡S−C−P
0
Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.
The Finance[BlackScholesGamma] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
See Also
Finance[AmericanOption]
Finance[BermudanOption]
Finance[BlackScholesDelta]
Finance[BlackScholesPrice]
Finance[BlackScholesRho]
Finance[BlackScholesTheta]
Finance[BlackScholesVega]
Finance[EuropeanOption]
Finance[ImpliedVolatility]
Finance[LatticePrice]
Download Help Document