Finance - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Financial Instruments : Greeks : Finance/BlackScholesGamma

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=2S02S

• 

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,t→maxt100,0,1,σ,r,d

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

(3)

BlackScholesGamma100,t→maxt100,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'

2ⅇσ44ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2σ2+2ⅇσ4+4ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2σ2+2ⅇσ44ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2ln22ⅇσ44ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2d+2ⅇσ44ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2r4ⅇσ4+4ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2ln2+4ⅇσ4+4ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2d4ⅇσ4+4ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2r800πσ3

(6)

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

0.000529595076

(7)

BlackScholesGamma100,t→max50t,0,1,σ,r,d

ⅇr2ⅇσ2+2ln22d+2r28σ2σ2+2ⅇσ4+4ln2σ2+4dσ24rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2σ2+2ⅇσ2+2ln22d+2r28σ2ln22ⅇσ2+2ln22d+2r28σ2d+2ⅇσ2+2ln22d+2r28σ2r4ⅇσ4+4ln2σ2+4dσ24rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2ln2+4ⅇσ4+4ln2σ2+4dσ24rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2d4ⅇσ4+4ln2σ2+4dσ24rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2r800πσ3

(8)

BlackScholesGamma100,t→max50t,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;t&rarr;piecewiset<50&comma;50t&comma;t<100&comma;0&comma;t100&comma;1&comma;&sigma;&comma;r&comma;d

S&ExponentialE;r24&ExponentialE;σ2+2d2r28σ2σ2+2&ExponentialE;σ4+4ln2σ2+4dσ24rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2σ24&ExponentialE;σ4+4ln2σ2+4dσ24rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2ln2+4&ExponentialE;σ4+4ln2σ2+4dσ24rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2d4&ExponentialE;σ4+4ln2σ2+4dσ24rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2r+&ExponentialE;σ2+2ln22d+2r28σ2σ2+2&ExponentialE;σ2+2ln22d+2r28σ2ln22&ExponentialE;σ2+2ln22d+2r28σ2d+2&ExponentialE;σ2+2ln22d+2r28σ2r800πσ3

(10)

CBlackScholesGamma100&comma;100&comma;1&comma;&sigma;&comma;r&comma;d&comma;&apos;call&apos;

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

(11)

PBlackScholesGamma100&comma;50&comma;1&comma;&sigma;&comma;r&comma;d&comma;&apos;put&apos;

P2&ExponentialE;σ44ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2σ2+2&ExponentialE;σ4+4ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2σ2+2&ExponentialE;σ44ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2ln22&ExponentialE;σ44ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2d+2&ExponentialE;σ44ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2r4&ExponentialE;σ4+4ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2ln2+4&ExponentialE;σ4+4ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2d4&ExponentialE;σ4+4ln2σ2+4dσ2+4rσ2+4ln228ln2d+8ln2r+4d28dr+4r28σ2r800πσ3

(12)

Check:

simplifySCP

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]