LINEBURG

if (dividend times[i]<=time to maturity){

adjusted S ’= dividend amounts[i] * exp(’r*dividend times[i]);

};

};

return option price call black scholes(adjusted S,K,r,sigma,time to maturity);

};

Code 8.2: European option price, dividend paying stock

51

The program

void test black scholes with dividends(){

double S = 100.0; double K = 100.0;

double r = 0.1; double sigma = 0.25;

double time=1.0;

double dividend yield=0.05;

vector<double> dividend times; vector<double> dividend amounts;

dividend times.push back(0.25); dividend amounts.push back(2.5);

dividend times.push back(0.75); dividend amounts.push back(2.5);

cout << " european stock call option with contininous dividend = "

<< option price european call payout(S,K,r,dividend yield,sigma,time) << endl;

cout << " european stock call option with discrete dividend = "

<< option price european call dividends(S,K,r,sigma,time,dividend times,dividend amounts) << endl;

};

provides the output

european stock call option with contininous dividend = 11.7344

european stock call option with discrete dividend = 11.8094

8.2 American options.

American options are much harder to deal with than European ones. The problem is that it may be optimal

to use (exercise) the option before the ¬nal expiry date. This optimal exercise policy will a¬ect the value of

the option, and the exercise policy needs to be known when solving the pde. There is therefore no general

analytical solutions for American call and put options. There is some special cases. For American call

options on assets that do not have any payouts, the American call price is the same as the European one,

since the optimal exercise policy is to not exercise. For American Put is this not the case, it may pay to

exercise them early. When the underlying asset has payouts, it may also pay to exercise the option early.

There is one known known analytical price for American call options, which is the case of a call on a stock

that pays a known dividend once during the life of the option, which is discussed next. In all other cases the

American price has to be approximated using one of the techniques discussed in later chapters: Binomial

approximation, numerical solution of the partial di¬erential equation, or another numerical approximation.

8.2.1 Exact american call formula when stock is paying one dividend.

When a stock pays dividend, a call option on the stock may be optimally exercised just before the stock goes

ex-dividend. While the general dividend problem is usually approximated somehow, for the special case of one

dividend payment during the life of an option an analytical solution is available, due to Roll“Geske“Whaley.

If we let S be the stock price, K the exercise price, D1 the amount of dividend paid, t1 the time of dividend

payment, T the maturity date of option, we denote the time to dividend payment „1 = T ’ t1 and the time

to maturity „ = T ’ t.

A ¬rst check of early exercise is:

D1 ¤ K 1 ’ e’r(T ’t1 )

If this inequality is ful¬lled, early exercise is not optimal, and the value of the option is

c(S ’ e’r(t1 ’t) D1 , K, r, σ, (T ’ t))

where c(·) is the regular Black Scholes formula.

If the inequality is not ful¬lled, one performs the calculation shown in formula 8.2 and implemented in

code 8.3

52

C = (S ’ D1 e’r(t1 ’t) ) (N (b1 ) + N (a1 , ’b1 , ρ)) + Ke’r(T ’t)) N (a2 , ’b2 , ρ) ’ (K ’ D1 )e’r(t1 ’t) N (b2 )

where

(t1 ’ t

ρ=’

T ’t

S’D1 e’q(„1

+ (r + 1 σ 2 )„

ln K 2

√

a1 =

σ„

√

a2 = a1 ’ σ T ’ t

S’D1 e’r(t1 ’t)

+ (r + 1 σ 2 )(t1 ’ t)

ln ¯ 2

S

b1 =

(t1 ’ t)

σ

√

b 2 = b1 ’ σ T ’ t

¯

and S solves

¯ ¯

c(S, t1 ) = S + D1 ’ K

S is the price of the underlying secrutity, K the exercise price, r the risk free interest rate, D1 is the dividend amount and σ the

standard deviation of the underlying asset, t the current date, T the maturity date, T ’ t the time to maturity for the option and

N (·) the cumulative normal distribution. N () with one argument is the univariate normal cumulative distribution. N () with three

arguments is the bivariate normal distribution with the correlation between the two normals given as the third arguement.

Formula 8.2: Roll“Geske“Whaley price of american call option paying one ¬xed dividend

Exercise 6.

The Black approximation to the price of an call option paying a ¬xed dividend is an approximation to the value

of the call. Suppose the dividend is paid as some date t1 before the maturity date of the option T . Blacks

approximation calculates the value of two European options using the Black Scholes formula. One with expiry

date equal to the ex dividend date of the options. Another with expiry date equal to the option expiry, but the

current price of the underlying security is adjusted down by the amount of the dividend.

1. Implement Black™s approximation.

53

#include <cmath>

#include "normdist.h" // de¬ne the normal distribution functions

#include "fin_recipes.h" // the regular black sholes formula

double option price american call one dividend(const double& S,

const double& K,

const double& r,

const double& sigma,

const double& tau,

const double& D1,

const double& tau1){

if (D1 <= K* (1.0’exp(’r*(tau’tau1)))) // check for no exercise

return option price call black scholes(S’exp(’r*tau1)*D1,K,r,sigma,tau);

const double ACCURACY = 1e’6; // decrease this for more accuracy

double sigma sqr = sigma*sigma;

double tau sqrt = sqrt(tau);

double tau1 sqrt = sqrt(tau1);

double rho = ’ sqrt(tau1/tau);

double S bar = 0; // ¬rst ¬nd the S bar that solves c=S bar+D1-K

double S low=0; // the simplest: binomial search

double S high=S; // start by ¬nding a very high S above S bar

double c = option price call black scholes(S high,K,r,sigma,tau’tau1);

double test = c’S high’D1+K;

while ( (test>0.0) && (S high<=1e10) ) {

S high *= 2.0;

c = option price call black scholes(S high,K,r,sigma,tau’tau1);

test = c’S high’D1+K;

};

if (S high>1e10) { // early exercise never optimal, ¬nd BS value

return option price call black scholes(S’D1*exp(’r*tau1),K,r,sigma,tau);

};

S bar = 0.5 * S high; // now ¬nd S bar that solves c=S bar-D+K

c = option price call black scholes(S bar,K,r,sigma,tau’tau1);

test = c’S bar’D1+K;

while ( (fabs(test)>ACCURACY) && ((S high’S low)>ACCURACY) ) {

if (test<0.0) { S high = S bar; }

else { S low = S bar; };

S bar = 0.5 * (S high + S low);

c = option price call black scholes(S bar,K,r,sigma,tau’tau1);

test = c’S bar’D1+K;

};

double a1 = (log((S’D1*exp(’r*tau1))/K) +( r+0.5*sigma sqr)*tau) / (sigma*tau sqrt);

double a2 = a1 ’ sigma*tau sqrt;

double b1 = (log((S’D1*exp(’r*tau1))/S bar)+(r+0.5*sigma sqr)*tau1)/(sigma*tau1 sqrt);

double b2 = b1 ’ sigma * tau1 sqrt;

double C = (S’D1*exp(’r*tau1)) * N(b1) + (S’D1*exp(’r*tau1)) * N(a1,’b1,rho)

’ (K*exp(’r*tau))*N(a2,’b2,rho) ’ (K’D1)*exp(’r*tau1)*N(b2);

return C;

};

Code 8.3: Option price, Roll“Geske“Whaley call formula for dividend paying stock

54

The program

void test rgw price am call div(){

double S = 100.0; double K = 100.0;

double r = 0.1; double sigma = 0.25;

double tau = 1.0; double tau1 = 0.5;

double D1 = 10.0;

cout << " american call price with one dividend = "

<< option price american call one dividend(S,K,r,sigma,tau,D1, tau1)<< endl;

};

provides the output

american call price with one dividend = 10.0166

Example 8.1: Example of pricing of option on stock paying one dividend during the life of the option

55

8.3 Options on futures

8.3.1 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]. Essentially we replace S0 with e’r(T ’t)r F in the Black Scholes formula,

and get the formula shown in 8.3 and implemented in code 8.4.

c = e’r(T ’t) (F N (d1 ) ’ KN (d2 ))

where

F

+ 1 σ 2 (T ’ t)

ln K

√2

d1 =

σ T ’t

√

d2 = d1 ’ σ T ’ t

F is the futures price, K is the exercise price, r the risk free interest rate, σ the volatility of the futures

price, and T ’ t is the time to maturity of the option (in years).

Formula 8.3: Blacks formula for the price of an European Call option with a futures contract as the

underlying security

#include <cmath> // mathematics library

// normal distribution

#include "normdist.h"

using namespace std;

double futures option price call european black( const double& F, // futures price

const double& K, // exercise price

const double& r, // interest rate

const double& sigma, // volatility

const double& time){ // time to maturity

double sigma sqr = sigma*sigma;

double time sqrt = sqrt(time);

double d1 = (log (F/K) + 0.5 * sigma sqr * time) / (sigma * time sqrt);

double d2 = d1 ’ sigma * time sqrt;

return exp(’r*time)*(F * N(d1) ’ K * N(d2));

};

Code 8.4: Price of European Call option on Futures contract

The program

void test futures option price black(){

double F = 50.0; double K = 45.0;

double r = 0.08; double sigma = 0.2;

double time=0.5;

cout << " european futures call option = "

<< futures option price put european black(F,K,r,sigma,time) << endl;

};

provides the output

european futures call option = 0.851476

Example 8.2: Pricing of Futures option using the Black formula

Exercise 7.

56

The Black formula for a put option on a futures contract is

p = e’r(T ’t) (KN (’d2 ) ’ F N (’d1 ))

where the varibles are as de¬ned for the call option.

1. Implement the put option price.

57

8.4 Foreign Currency Options

Another relatively simple adjustment of the Black Scholes formula occurs when the underlying security is a

currency exchange rate (spot rate). In this case one adjusts the Black-Scholes equation for the interest-rate

di¬erential.

Let S be the spot exchange rate, and now let r be the domestic interest rate and rf the foreign interest rate.

σ is then the volatility of changes in the exchange rate. The calculation of the price of an European call

option is then shown in formula 8.4 and implented in code 8.5.

c = Se’rf (T ’t) N (d1 ) ’ Ke’r(T ’t) N (d2 )

where

S

+ r ’ rf + 1 σ 2 (T ’ t)

ln K 2

√

d1 =

σ T ’t

√

d2 = d1 ’ σ T ’ t

S is the spot exchange rate and K the exercise price. r is the domestic interest rate and rf the foreign interest rate. σ is the volatility

of changes in the exchange rate. T ’ t is the time to maturity for the option.

Formula 8.4: European currency call

#include <cmath>

#include "normdist.h" // de¬ne the normal distribution function

double currency option price call european( const double& S, // exchange rate,

const double& X, // exercise,

const double& r, // r domestic,

const double& r f, // r foreign,

const double& sigma, // volatility,

const double& time){ // time to maturity

double sigma sqr = sigma*sigma;

double time sqrt = sqrt(time);

double d1 = (log(S/X) + (r’r f+ (0.5*sigma sqr)) * time)/(sigma*time sqrt);

double d2 = d1 ’ sigma * time sqrt;

return S * exp(’r f*time) * N(d1) ’ X * exp(’r*time) * N(d2);

};

Code 8.5: European Futures Call option on currency

The program

void test currency option european call(){

double S = 50.0; double K = 52.0;

double r = 0.08; double rf=0.05;

double sigma = 0.2; double time=0.5;

cout << " european currency call option = "

<< currency option price call european(S,K,r,rf,sigma,time) << endl;

};

provides the output

european currency call option = 2.22556

Example 8.3: Pricing a foreign currency call option

Exercise 8.

58

The price for an european put for a currency option is

p = Ke’r(T ’t) N (’d2 ) ’ Se’rf (T ’t) N (’d1 )

1. Implement this formula.

59

8.5 Perpetual puts and calls

A perpetal option is one with no maturity date, it is ini¬nitely lived. Of course, only American perpetual

options make any sense, European perpetual options would probably be hard to sell.1 For both puts and

calls analytical formulas has been developed. We consider the price of an American call, and discuss the put

in an exercise. Formula 8.5 gives the analytical solution.

h1

h1 ’ 1 S

K

p

C=

h1 ’ 1 h1 K

where

2

1 r’q r’q 1 2r

h1 = ’ ’

+ +

σ2 σ2 σ2

2 2

S is the current price of the underlying security, K is the exercise price, r is the risk free interest rate, q is the dividend yield and σ is

the volatility of the underlying asset.

Formula 8.5: Price for a perpetual call option

#include <cmath>

using namespace std;

double option price american perpetual call(const double& S,

const double& K,

const double& r,

const double& q,

const double& sigma){

double sigma sqr=pow(sigma,2);

double h1 = 0.5’ ((r’q)/sigma sqr);

h1 += sqrt(pow(((r’q)/sigma sqr’0.5),2)+2.0*r/sigma sqr);

double pric=(K/(h1’1.0))*pow(((h1’1.0)/h1)*(S/K),h1);

return pric;

};

Code 8.6: Price for an american perpetual call option

The program

void test option price perpetual american call(){

Copyright Design by: Sunlight webdesign