next up previous contents index
Next: Foreign Currency Algoritms Up: Futures algoritms. Previous: Pricing of futures contract.   Contents   Index

Subsections


Options on futures

One of the more interesting problems with futures contracts is to value an option written on a futures contract.


Black's model

For an European option written on a futures contract, we use an adjustment of the Black Scholes solution, which was developed in Black (1976)

See (Hull, 1993, Ch 11.4) for a textbook treatment.


\begin{displaymath}d_1 =
\frac{\log \left(\frac{F}{X} \right) + \frac{1}{2}\sigma^2(T-t)}
{\sigma\sqrt{T-t}} \end{displaymath}


\begin{displaymath}d_2 = d_1 - \sigma\sqrt{T-t} \end{displaymath}


\begin{displaymath}c = e^{-r(T-t)}\left( FN(d_1) - XN(d_2) \right) \end{displaymath}


\begin{displaymath}p = e^{-r(T-t)}\left( XN(-d_2) - FN(-d_1) \right) \end{displaymath}

Computer algoritm.



// file futures_opt_call_black.cc
// author: Bernt A Oedegaard

#include <cmath>                                 // mathematics library
#include "normdist.h"                             // normal distribution

double futures_option_price_call_european_black(
   double F,     // futures price
   double X,     // exercise price
   double r,     // interest rate
   double sigma, // volatility
   double time)   // time to maturity
{
    double sigma_sqr = sigma*sigma;
    double time_sqrt = sqrt(time);
    double d1 = (log (F/X) + 0.5 * sigma_sqr * time) / (sigma * time_sqrt);
    double d2 = d1 - sigma * time_sqrt;
    return exp(-r*time)*(F * N(d1) - X * N(d2));
};


Binomial approximation.

For American options, because of the feasibility of early exercise, the binomial model is often used to approximate the option value.



// file: futures_opt_call_bin.cc
// author: Bernt A Oedegaard

#include <cmath>
#include <algorithm>
#include <vector>

double futures_option_price_call_american_binomial(
    double F, double X, double r, double sigma, double time, int no_steps) {
   vector<double> futures_prices(no_steps+1);
   vector<double> call_values (no_steps+1);
   double t_delta= time/no_steps;
   double Rinv = exp(-r*(t_delta));
   double u = exp(sigma*sqrt(t_delta));
   double d = 1.0/u;
   double uu= u*u;
   double pUp   = (1-d)/(u-d);   // note how probability is calculated
   double pDown = 1.0 - pUp;
   futures_prices[0] = F*pow(d, no_steps);
   int i;
   for (i=1; i<=no_steps; ++i) futures_prices[i] = uu*futures_prices[i-1]; // terminal tree nodes
   for (i=0; i<=no_steps; ++i) call_values[i] = max(0.0, (futures_prices[i]-X));
   for (int step=no_steps-1; step>=0; --step) {
      for (i=0; i<=step; ++i)   {
	 futures_prices[i] = d*futures_prices[i+1];
	 call_values[i] = (pDown*call_values[i]+pUp*call_values[i+1])*Rinv;
	 call_values[i] = max(call_values[i], futures_prices[i]-X); // check for exercise
      };
   };
   return call_values[0];
};



next up previous contents index
Next: Foreign Currency Algoritms Up: Futures algoritms. Previous: Pricing of futures contract.   Contents   Index
Bernt Arne Odegaard
1999-09-09