The Spread Option Package
Version 1.0,  Mathematica 3.0
By Espen Gaarder Haug
Copyright 1999

Key words: 
Option Pricing,  Spread Options,  Crack Spreads,  Spark Spreads

THE PACKAGE:
The Spread Option Package can be used for valuation and sensitivity analysis of Spread Options. Spread options are popular in many markets, and especially in the energy markets. At New York Mercantile Exchange (NYMEX)spread options are traded on the spread/difference between heating oil and crude oil, as well as between gasoline and crude oil. These spreads are better known as crack spreads. And options on these spreads are known as crack spread options. Crack spread options are useful to refineries for hedging purposes.

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 implemented here assumes a Black and Scholes world, that is the future prices follows a geometric Brownian motion (the future prices are assumed to be Log-normal distributed etc.) 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.

OPTION VALUATION EXAMPLE: 
Consider a put option on the spread/difference between two future contracts. Time to maturity is 6 months. The price of future contract one is 143, the price of futures contract two is 122, the strike price is 20, the 6 month risk free interest rate is 8% per annum (continuously compounding, the volatility of future contract one is 35%, the volatility of future contract two is 26%, and the correlation between the instantaneous returns of the two futures is 0.64. What is the option value?

First append to Mathematica's $Path variable the path to the file SpreadOption.m so that Mathematica can find the package (in the following change path to the correct path on your machine).

AppendTo[$Path,path]

Now load the package.

Needs["SpreadOption`"]

SpreadOption[-1, 143, 122, 20, 0.5, 0.08, 0.35, 0.26, 0.64]

What will happen with the option value if the volatility of future contract one should change by one percent point?

SpreadOptionVega1[143, 122, 20, 0.5, 0.08, 0.35, 0.26, 0.64]

What will happen with this spread option if both the volatility of futures one and two changes over a large interval?

Plot3D[
      SpreadOption[-1, 143, 122, 20, 0.5, 0.08, v1, v2, 0.64], {v1, 0.25, 
        0.45}, {v2, 0.16, 0.36}, PlotRange -> All, 
      AxesLabel -> {"Vol. Future 1", "Vol.Future 2", " Value"}, 
      ViewPoint -> {-0.800,  -1.200,  1.00}, 
      BoxRatios -> {1, 1, 0.8}]

What about the Gamma risk for future contract two with respect to changes in time and correlation?

Plot3D[
      SpreadOptionGamma2[F1, F2, 20, 0.5, 0.08, 0.35, 0.26, 0.64], {F1, 120, 
        160}, {F2, 100, 140}, PlotRange -> All, 
      AxesLabel -> {"Future 1", "Future 2", "Gamma 2"}, 
      ViewPoint -> {-0.800,  -1.200,  1.00}, 
      BoxRatios -> {1, 1, 0.8}]

What about time value, how much will the option change in value if we get one day closer to maturity, ceteris paribus.

SpreadOptionTheta[-1, 143, 122, 20, 0.5, 0.08, 0.35, 0.26, 0.64]

But what about our Theta value if the two futures contracts simultaniously should move

Plot3D[
      SpreadOptionTheta[-1, 143, 122, 20, 0.5, 0.08, v1, v2, 0.64], {v1, 
        0.25, 0.45}, {v2, 0.16, 0.36}, PlotRange -> All, 
      AxesLabel -> {"Vol. Future 1", "Vol.Future 2", " Theta"}, 
      ViewPoint -> {-0.800,  -1.200,  1.00}, 
      BoxRatios -> {1, 1, 0.8}]

Well that was just a few examples of how you can use the SpreadOption Package. You can naturally get more information about the Spread Option Package by typing : ?SpreadOption followed by "Enter". The same is true for every function included in the package. Mathematica can help you turn option models into numbers and nice graphic!  It can even help you develop new option pricing models. All these can be very useful in the option market. But remember a option model is still just a model and not the market! With these words I just wish you Good Luck in your Spread Option Trading!

Espen G. Haug
Home page: http://home.sol.no/~eshaug/