BlackScholesGamma - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Finance

  

BlackScholesGamma

  

compute the Gamma of a European-style option with given payoff

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

BlackScholesGamma(S0, K, T, sigma, r, d, optiontype)

BlackScholesGamma(S0, P, T, sigma, r, d)

Parameters

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

Description

• 

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.

Examples

> 

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⁢σ⁢π

(1)

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

(2)

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

2⁢ⅇ−σ4+4⁢d⁢σ2+4⁢r⁢σ2+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2200⁢σ⁢π

(3)
> 

BlackScholesGamma⁡100,t↦max⁡t−100,0,1,0.3,0.05,0.03

0.01260567513

(4)
> 

BSGamma≔expand⁡BlackScholesGamma⁡100,100,1,σ,r,0.03,call

BSGamma≔0.001965014020⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ−0.1249999999⁢σ2⁢ⅇ−0.0004499999997σ2⁢ⅇ−0.4999999997⁢rσ+0.0001179008410⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ−0.1249999999⁢σ2⁢ⅇ−0.0004499999997σ2⁢ⅇ−0.4999999997⁢rσ3−0.003930028034⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ−0.1249999999⁢σ2⁢r⁢ⅇ−0.0004499999997σ2⁢ⅇ−0.4999999997⁢rσ3−0.0001179008410⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ−0.1249999999⁢σ2⁢ⅇ−0.5000000002⁢r⁢ⅇ−0.0004499999998σ2σ3+0.003930028033⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ−0.1249999999⁢σ2⁢r⁢ⅇ−0.5000000002⁢r⁢ⅇ−0.0004499999998σ2σ3+0.001965014018⁢ⅇ0.02999999998⁢rσ2⁢ⅇ−0.4999999997⁢r2σ2⁢ⅇ−0.1249999999⁢σ2⁢ⅇ−0.5000000002⁢r⁢ⅇ−0.0004499999998σ2σ

(5)
> 

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⁢σ⁢π

(6)
> 

BlackScholesGamma⁡100,50,1,0.3,0.05,0.03,put

0.000529595076

(7)
> 

BlackScholesGamma⁡100,t↦max⁡50−t,0,1,σ,r,d

2d−rσ2⁢ⅇ−σ4+4⁢d⁢σ2+4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2200⁢σ⁢π

(8)
> 

BlackScholesGamma⁡100,t↦max⁡50−t,0,1,0.3,0.05,0.03,d

0.0005295950875

(9)

In this example, you will compute the Gamma of a strangle.

> 

S≔BlackScholesGamma⁡100&comma;t↦piecewise⁡t<50&comma;50−t&comma;t<100&comma;0&comma;t−100&comma;1&comma;σ&comma;r&comma;d

S≔2⁢&ExponentialE;−σ4+4⁢d⁢σ2+4⁢r⁢σ2+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2⁢2σ2+2⁢d−2⁢r2⁢σ2⁢&ExponentialE;−ln⁡222⁢σ2+2400⁢σ⁢π

(10)
> 

C≔BlackScholesGamma⁡100&comma;100&comma;1&comma;σ&comma;r&comma;d&comma;call

C≔2⁢&ExponentialE;−σ4+4⁢d⁢σ2+4⁢r⁢σ2+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2200⁢σ⁢π

(11)
> 

P≔BlackScholesGamma⁡100&comma;50&comma;1&comma;σ&comma;r&comma;d&comma;put

P≔2d−rσ2⁢&ExponentialE;−σ4+4⁢d⁢σ2+4⁢r⁢σ2+4⁢ln⁡22+4⁢d2−8⁢d⁢r+4⁢r28⁢σ2200⁢σ⁢π

(12)

Check:

> 

expand⁡simplify⁡S−C−P

0

(13)

References

  

Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.

Compatibility

• 

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]