(* :Title: Spread Option Pricing Model *)
(* :Author: Espen Gaarder Haug *)
(* :Summary:
Calculates the value
for European call and put options on the difference between two futures
contracts, better known as spread options.*)
(* :Context: SpreadOption` *)
(* :Package Version: 1.0, Last modified June 6, 1999 *)
(* :Copyright: Copyright (c) 1999 Espen Gaarder Haug *)
(* :Keywords:
option pricing, spread option, financial derivatives, crack spread options,
spark spread options.
*)
(* :Mathematica Versions 3.0 *)
BeginPackage["SpreadOption`"]
(* Usage Statments and Description *)
SpreadOption::usage =
"The SpreadOption package implemented by Espen Gaarder Haug
(the author of 'The Complete Guide to Option Pricing Formulas') can be
used for valuation and sensitivity analysis of European spread options
on futures and forward contracts.
Functions included are:
SpreadOption calculates the spread option value, SpreadOptionDelta1 and
SpreadOptionDelta2 calculates the Delta values, SpreadOptionGamma1 and
SpreadOptionGamma2 calculates the Gamma values, SpreadOptionVega1 and
SpreadOptionVega2 calculates the Vega values, SpreadOptionTheta
calculates the Theta value, SpreadOptionRho calculates the Rho values, and
SpreadOptionCor calculates the sensitivity for changes in the
correaltion coeficient,
A call spread option on two futures contracts will at maturity pay
Max[F1-F2-X,0], where F1 is the price of future one at maturity,
and F2 is the price of future two at maturity, X is the strike price.
Similarly the payoff from a put spread option is Max[X-F1+F2,0].
Spread options are popular in many markets, and especially in the
energy markets. At New York Mercantile Exchange spread options are
traded on the spread/difference between heating oil and crude oil, as well
as between gasoline and crude oil. These are better known as crack spread
options.
With the deregulation of the electricity/power markets around the world,
hedgers and risk takers are now also doing options on the price difference
between oil and electricity. In the energy market such options
are known as spark spread options.
The valuation formula here assumes a Black-Scholes world, that is the future
price follows a geometric Brownian motion (the future prices are
Log-normal distributed etc.). Since the option is on two future contracts,
that means two correlated geometric Brownian motions.
The implementation is based on the formula published by: Kirk, E. 1995:
'Correlation in the Energy Markets,' in Managing Energy Price Risk. London:
Risk Publications and Enron, 71-78. This is actually an approximation, but
it is very accurate with respect to all practical purposes. More information
on valuation of both European and American style spread options can be found
in: Haug, E. G. 1997: 'The Complete Guide To Option Pricing Formulas,'
McGraw-Hill, New York. "
SpreadOptionDelta1::usage =
"SpreadOptionDelta1[CPFlag, F1, F2, X, T, r, v1, v2, rho] calculates the
delta-one for a European spread option. That is the the change in option \
value for
a small change in future contract one (F1).
CPFLag=1 for call option, -1 for put option.
A call spread option on two futures contracts will at maturity pay
Max[F1-F2-X,0], where F1 is the price of future one at maturity, and F2 is
the price of future two at maturity, X is the strike price. Similarly the \
payoff
from a put spread option is Max[X-F1+F2,0]. T=time to maturity in years,
r=risk-free interest rate, v1=volatility of future contract one,
v2=volatility of future contract two, rho=correlation between the
return of the two futures contracts"
SpreadOptionDelta2::usage =
"SpreadOptionDelta2[CPFlag, F1, F2, X, T, r, v1, v2, rho] calculates the
delta-two for a European spread option. That is the change in option value \
for
a small change in future contract two (F2).
CPFLag=1 for call option, -1 for put option.
A call spread option on two futures contracts will at maturity pay
Max[F1-F2-X,0], where F1 is the price of future one at maturity, and F2 is
the price of future two at maturity, X is the strike price. Similarly the \
payoff
from a put spread option is Max[X-F1+F2,0]. T=time to maturity in years,
r=risk-free interest rate, v1=volatility of future contract one,
v2=volatility of future contract two, rho=correlation between the
return of the two futures contracts"
SpreadOptionGamma1::usage =
"SpreadOptionGamma1[ F1, F2, X, T, r, v1, v2, rho] calculates the
Gamma-one for a European spread option. That is the second derivatives of the
option value with respect to future contract one (F1).
Same for call and put.
A call spread option on two futures contracts will at maturity pay
Max[F1-F2-X,0], where F1 is the price of future one at maturity, and F2 is
the price of future two at maturity, X is the strike price. Similarly the \
payoff
from a put spread option is Max[X-F1+F2,0]. T=time to maturity in years,
r=risk-free interest rate, v1=volatility of future contract one,
v2=volatility of future contract two, rho=correlation between the
return of the two futures contracts"
SpreadOptionGamma2::usage =
"SpreadOptionGamma2[ F1, F2, X, T, r, v1, v2, rho] calculates the
Gamma-two for a European spread option. That is the second derivatives of the
option value with respect to future contract two (F2).
Same for call and put.
A call spread option on two futures contracts will at maturity pay
Max[F1-F2-X,0], where F1 is the price of future one at maturity, and F2 is
the price of future two at maturity, X is the strike price. Similarly the \
payoff
from a put spread option is Max[X-F1+F2,0]. T=time to maturity in years,
r=risk-free interest rate, v1=volatility of future contract one,
v2=volatility of future contract two, rho=correlation between the
return of the two futures contracts"
SpreadOptionVega1::usage =
"SpreadOptionVega1[ F1, F2, X, T, r, v1, v2, rho] calculates the
Vega-one for a European spread option. That is the first derivatives of the
option value with respect to the volatility of futures contract one (v1).
The Vega number have been divided by 100 to get it for percent point changes
(the practical market 'standard').
Same for call and put.
A call spread option on two futures contracts will at maturity pay
Max[F1-F2-X,0], where F1 is the price of future one at maturity, and F2 is
the price of future two at maturity, X is the strike price. Similarly the \
payoff
from a put spread option is Max[X-F1+F2,0]. T=time to maturity in years,
r=risk-free interest rate, v1=volatility of future contract one,
v2=volatility of future contract two, rho=correlation between the
return of the two futures contracts"
SpreadOptionVega2::usage =
"SpreadOptionVega2[ F1, F2, X, T, r, v1, v2, rho] calculates the
Vega-two for a European spread option. That is the first derivatives of the
option value with respect to the volatility of futures contract two (v2).
The Vega number have been divided by 100 to get it for percent point changes
(the practical market 'standard').
Same for call and put.
A call spread option on two futures contracts will at maturity pay
Max[F1-F2-X,0], where F1 is the price of future one at maturity, and F2 is
the price of future two at maturity, X is the strike price. Similarly the \
payoff
from a put spread option is Max[X-F1+F2,0]. T=time to maturity in years,
r=risk-free interest rate, v1=volatility of future contract one,
v2=volatility of future contract two, rho=correlation between the
return of the two futures contracts"
SpreadOptionTheta::usage =
"SpreadOptionTheta[CPFlag, F1, F2, X, T, r, v1, v2, rho] calculates the
Theta value for a European spread option. That is partial derivatives of the \
option value
with respect to time to expiration (T).
The Theta number have been divided by 365 to get it on a daily basis. I have \
also
taken the minus value of the partial derivatives. This because we always get \
closer to
expiration, time moves in one direction. That is the theta value that comes \
out is
a approximation for what will happen with the option value as you get one day \
closer
to maturity (the market 'standard').
CPFLag=1 for call option, -1 for put option.
A call spread option on two futures contracts will at maturity pay
Max[F1-F2-X,0], where F1 is the price of future one at maturity, and F2 is
the price of future two at maturity, X is the strike price. Similarly the \
payoff
from a put spread option is Max[X-F1+F2,0]. T=time to maturity in years,
r=risk-free interest rate, v1=volatility of future contract one,
v2=volatility of future contract two, rho=correlation between the
return of the two futures contracts"
SpreadOptionRho::usage =
"SpreadOptionRho[CPFlag, F1, F2, X, T, r, v1, v2, rho] calculates the
Rho value for a European spread option. That is partial derivatives of the \
option value
with respect to the risk-free interest rate (r).
The Rho number have been divided by 100 to get it for percent point changes
(the market standard).
CPFLag=1 for call option, -1 for put option.
A call spread option on two futures contracts will at maturity pay off
Max[F1-F2-X,0], where F1 is the price of future one at maturity, and F2 is
the price of future two at maturity, X is the strike price. Similarly the \
payoff
from a put spread option is Max[X-F1+F2,0]. T=time to maturity in years,
r=risk-free interest rate, v1=volatility of future contract one,
v2=volatility of future contract two, rho=correlation between the
return of the two futures contracts"
SpreadOptionCor::usage =
"SpreadOptionCor[F1, F2, X, T, r, v1, v2, rho] calculates the
the first derivatives of the option value with respect to the correaltion
coefficient (Rho). The partial derivatives have then been divided by 10 to
get it for a 0.1 change in correlation.
Same for call and put.
A call spread option on two futures contracts will at maturity pay off
Max[F1-F2-X,0], where F1 is the price of future one at maturity, and F2 is
the price of future two at maturity, X is the strike price. Similarly the \
payoff
from a put spread option is Max[X-F1+F2,0]. T=time to maturity in years,
r=risk-free interest rate, v1=volatility of future contract one,
v2=volatility of future contract two, rho=correlation between the
return of the two futures contracts"
Begin["`Private`"]
cnd[z_] := (1 + Erf[z / Sqrt[2]]) / 2;
vv[F1_,F2_,X_,v1_,v2_,rho_]:=Sqrt[v1^2+(v2*F2/(F2+X))^2-2*rho*v1*v2*F2/(F2+X)];
d1[F_,T_,r_,vv_]:=(Log[F]+vv^2/2*T)/(vv*Sqrt[T]);
d2[F_,T_,r_,vv_]:= (Log[F]-vv^2/2*T)/(vv*Sqrt[T]);
SpreadOption[CPFlag_,F1_,F2_,X_,T_,r_,v1_,v2_,rho_]:=
CPFlag*(F2+X)* \
Exp[-r*T]*(F1/(F2+X)*cnd[CPFlag*d1[F1/(F2+X),T,r,vv[F1,F2,X,v1,v2,rho]]]-
cnd[CPFlag*d2[F1/(F2+X),T,r,vv[F1,F2,X,v1,v2,rho]]]);
SpreadOptionDelta1[CPFlag_,F1_,F2_,X_,T_,r_,v1_,v2_,rho_]=
Evaluate[D[SpreadOption[CPFlag,F1,F2,X,T,r,v1,v2,rho], F1]];
SpreadOptionDelta2[CPFlag_,F1_,F2_,X_,T_,r_,v1_,v2_,rho_]=
Evaluate[D[SpreadOption[CPFlag,F1,F2,X,T,r,v1,v2,rho], F2]];
SpreadOptionGamma1[F1_,F2_,X_,T_,r_,v1_,v2_,rho_]=
Evaluate[D[SpreadOption[1,F1,F2,X,T,r,v1,v2,rho], {F1,2}]];
SpreadOptionGamma2[F1_,F2_,X_,T_,r_,v1_,v2_,rho_]=
Evaluate[D[SpreadOption[1,F1,F2,X,T,r,v1,v2,rho], {F2,2}]];
SpreadOptionVega1[F1_,F2_,X_,T_,r_,v1_,v2_,rho_]=
Evaluate[D[SpreadOption[1,F1,F2,X,T,r,v1,v2,rho], v1]/100];
SpreadOptionVega2[F1_,F2_,X_,T_,r_,v1_,v2_,rho_]=
Evaluate[D[SpreadOption[1,F1,F2,X,T,r,v1,v2,rho], v2]/100];
SpreadOptionTheta[CPFlag_,F1_,F2_,X_,T_,r_,v1_,v2_,rho_]=Evaluate[
-D[SpreadOption[CPFlag,F1,F2,X,T,r,v1,v2,rho], T]/365];
SpreadOptionRho[CPFlag_,F1_,F2_,X_,T_,r_,v1_,v2_,rho_]=
Evaluate[D[SpreadOption[CPFlag,F1,F2,X,T,r,v1,v2,rho], r]/100];
SpreadOptionCor[F1_,F2_,X_,T_,r_,v1_,v2_,rho_]=
Evaluate[D[SpreadOption[1,F1,F2,X,T,r,v1,v2,rho], rho]/100];
End[]
EndPackage[]