BlackScholesGamma - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

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

withFinance:

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.

BlackScholesGamma100,100,1,σ,r,d,call

2ⅇσ4+4dσ2+4rσ2+4d28dr+4r28σ2200σπ

(1)

In this example you will use numeric values for the risk-free rate, the dividend yield, and the volatility.

BlackScholesGamma100,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.

BlackScholesGamma100,tmaxt100,0,1,σ,r,d

2ⅇσ4+4dσ2+4rσ2+4d28dr+4r28σ2200σπ

(3)

BlackScholesGamma100,tmaxt100,0,1,0.3,0.05,0.03

0.01260567513

(4)

BSGammaexpandBlackScholesGamma100,100,1,σ,r,0.03,call

BSGamma0.001965014020ⅇ0.1249999999σ2ⅇ0.4999999997rⅇ0.4999999997r2σ2ⅇ0.02999999998rσ2ⅇ0.0004499999997σ2σ+0.0001179008410ⅇ0.1249999999σ2ⅇ0.4999999997rⅇ0.4999999997r2σ2ⅇ0.02999999998rσ2ⅇ0.0004499999997σ2σ30.003930028034rⅇ0.1249999999σ2ⅇ0.4999999997rⅇ0.4999999997r2σ2ⅇ0.02999999998rσ2ⅇ0.0004499999997σ2σ30.0001179008410ⅇ0.5000000002rⅇ0.0004499999998σ2ⅇ0.02999999998rσ2ⅇ0.4999999997r2σ2ⅇ0.1249999999σ2σ3+0.003930028033rⅇ0.5000000002rⅇ0.0004499999998σ2ⅇ0.02999999998rσ2ⅇ0.4999999997r2σ2ⅇ0.1249999999σ2σ3+0.001965014018ⅇ0.5000000002rⅇ0.0004499999998σ2ⅇ0.02999999998rσ2ⅇ0.4999999997r2σ2ⅇ0.1249999999σ2σ

(5)

plot3dBSGamma,σ=0..1,r=0..1,axes=BOXED

Here are similar examples for the European put option.

BlackScholesGamma100,50,1,σ,r,d,put

2drσ2ⅇσ4+4dσ2+4rσ2+4ln22+4d28dr+4r28σ2200σπ

(6)

BlackScholesGamma100,50,1,0.3,0.05,0.03,put

0.000529595076

(7)

BlackScholesGamma100,tmax50t,0,1,σ,r,d

ⅇr22σ2+2d2r2σ2σ2ⅇσ4+4dσ24rσ2+4ln22+4d28dr+4r28σ223σ2+2d2r2σ2ln2ⅇσ4+4dσ24rσ2+4ln22+4d28dr+4r28σ2+23σ2+2d2r2σ2dⅇσ4+4dσ24rσ2+4ln22+4d28dr+4r28σ223σ2+2d2r2σ2rⅇσ4+4dσ24rσ2+4ln22+4d28dr+4r28σ2+ⅇσ2+2ln22d+2r28σ2σ2+2ln2ⅇσ2+2ln22d+2r28σ22ⅇσ2+2ln22d+2r28σ2d+2ⅇσ2+2ln22d+2r28σ2r800πσ3

(8)

BlackScholesGamma100,tmax50t,0,1,0.3,0.05,0.03,d

0.0005295950875

(9)

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

SBlackScholesGamma100&comma;tpiecewiset<50&comma;50t&comma;t<100&comma;0&comma;t100&comma;1&comma;σ&comma;r&comma;d

S&ExponentialE;r22σ2+2d2r2σ2σ2&ExponentialE;σ4+4dσ24rσ2+4ln22+4d28dr+4r28σ223σ2+2d2r2σ2ln2&ExponentialE;σ4+4dσ24rσ2+4ln22+4d28dr+4r28σ2+23σ2+2d2r2σ2d&ExponentialE;σ4+4dσ24rσ2+4ln22+4d28dr+4r28σ223σ2+2d2r2σ2r&ExponentialE;σ4+4dσ24rσ2+4ln22+4d28dr+4r28σ2+&ExponentialE;σ2+2ln22d+2r28σ2σ2+4&ExponentialE;σ2+2d2r28σ2σ2+2ln2&ExponentialE;σ2+2ln22d+2r28σ22&ExponentialE;σ2+2ln22d+2r28σ2d+2&ExponentialE;σ2+2ln22d+2r28σ2r800πσ3

(10)

CBlackScholesGamma100&comma;100&comma;1&comma;σ&comma;r&comma;d&comma;call

C2&ExponentialE;σ4+4dσ2+4rσ2+4d28dr+4r28σ2200σπ

(11)

PBlackScholesGamma100&comma;50&comma;1&comma;σ&comma;r&comma;d&comma;put

P2drσ2&ExponentialE;σ4+4dσ2+4rσ2+4ln22+4d28dr+4r28σ2200σπ

(12)

Check:

expandsimplifySCP

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]