LINEBURG

sigma high = 2.0 * sigma high; // keep doubling.

price = option price call black scholes(S,X,r,sigma high,time);

if (sigma high>HIGH VALUE) return ERROR; // panic, something wrong.

};

for (int i=0;i<MAX ITERATIONS;i++){

double sigma = (sigma low+sigma high)*0.5;

price = option price call black scholes(S,X,r,sigma,time);

double test = (price’option price);

if (fabs(test)<ACCURACY) { return sigma; };

if (test < 0.0) { sigma low = sigma; }

else { sigma high = sigma; }

};

return ERROR;

};

Code 6.4: Calculation of implied volatility of Black Scholes using bisections

Instead of this simple bracketing, which is actually pretty fast, and will (almost) always ¬nd the solution, we

can use the Newton“Raphson formula for ¬nding the root of an equation in a single variable. The general

description of this method starts with a function f () for which we want to ¬nd a root.

f (x) = 0.

44

The function f () needs to be di¬erentiable. Given a ¬rst guess x0 , iterate by

f (xi )

xi+1 = xi ’

f (xi )

until

|f (xi )| <

where is the desired accuracy.1

In our case

f (x) = cobs ’ cBS (σ)

and, each new iteration will calculate

cobs ’ cBS (σi )

σi+1 = σi +

’ ‚c‚σ ()

BS

Code 6.5 shows the calculation of implied volatility using Newton-Raphson.

#include "fin_recipes.h"

#include "normdist.h"

#include <cmath>

double option price implied volatility call black scholes newton(const double& S,

const double& X,

const double& r,

const double& time,

const double& option price) {

double sigma low = 1e’5; // check for arbitrage violations:

double price = option price call black scholes(S,X,r,sigma low,time);

if (price > option price) return 0.0; // if price at almost zero volatility greater than price, return 0

const int MAX ITERATIONS = 100;

const double ACCURACY = 1.0e’4;

double t sqrt = sqrt(time);

double sigma = (option price/S)/(0.398*t sqrt); // ¬nd initial value

for (int i=0;i<MAX ITERATIONS;i++){

price = option price call black scholes(S,X,r,sigma,time);

double di¬ = option price ’price;

if (fabs(di¬)<ACCURACY) return sigma;

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

double vega = S * t sqrt * n(d1);

sigma = sigma + di¬/vega;

};

return ’99e10; // something screwy happened, should throw exception

};

Code 6.5: Calculation of implied volatility of Black Scholes using Newton-Raphson

Note that to use Newton-Raphson we need the derivative of the option price. For the Black-Scholes formula

this is known, and we can use this. But for pricing formulas like the binomial, where the partial derivatives

are not that easy to calculate, simple bisection is the preferred algorithm.

1 For further discussion of the Newton-Raphson formula and bracketing, a good source is chapter 9 of Press et al. [1992]

45

Consider the same call option as in the previous examples. The option matures 6 months from now, at

which time the holder of the option can recive one unit of the underlying security by paying the exercise

price of K = 50. The current price of the underlying security is S = 50. The current risk free interest rate

(with continous compounding) for six month borrowing is 10%. To calculate we therefore use inputs S = 50,

K = 50, r = 0.10 and (T ’ t) = 0.5.

We are now told that the current option price is C = 2.5. The implied volatility is the σ which, input in the

Black Scholes formula with these other inputs, will produce an option price of C = 2.5.

The program

void test black scholes implied volatility(){

double S = 50; double K = 50; double r = 0.10; double time=0.50;

double C=2.5;

cout << " Black Scholes implied volatility using Newton search = ";

cout << option price implied volatility call black scholes newton(S,K,r,time,C) << endl;

cout << " Black Scholes implied volatility using bisections = ";

cout << option price implied volatility call black scholes bisections(S,K,r,time,C) << endl;

};

provides the output

Black Scholes implied volatility using Newton search = 0.0500427

Black Scholes implied volatility using bisections = 0.0500414

Example 6.3: Example ¬nding implied volatility using the Black Scholes formula

46

Chapter 7

Warrants

Contents

7.1 Warrant value in terms of assets . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

7.2 Valuing warrants when observing the stock value . . . . . . . . . . . . . . . . . 48

7.3 Readings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

A warrant is an option-like security on equity, but it is issued by the same company which has issued the

equity, and when a warrant is exercised, a new stock is issued. This new stock is issued at a the warrant

strike price, which is lower than the current stock price (If it wasn™t the warrant would not be exercised.)

Since the new stock is a a fractional right to all cash¬‚ows, this stock issue waters out, or dilutes, the equity

in a company. The degree of dilution is a function of how many warrants are issued.

7.1 Warrant value in terms of assets

Let K be the strike price, n the number of shares outstanding and m the number of warrants issues. Assume

each warrant is for 1 new share, and let At be the current asset value of ¬rm. Suppose all warrants are

exercised simultaneously. Then the assets of the ¬rm increase by the number of warrants times the strike

price of the warrant.

At + mK,

but this new asset value is spread over more shares, since each exercised warrant is now an equity. The

assets of the ¬rm is spread over all shares, hence each new share is worth:

At + mK

m+n

making each exercised warrant worth:

At + mK n At

’K = ’K

m+n m+n n

If we knew the current value of assets in the company, we could value the warrant in two steps:

At

1. Value the option using the Black Scholes formula and as the current stock price.

n

n

2. Multiply the resulting call price with m+n .

If we let Wt be the warrant value, the above arguments are summarized as:

n A

, K, σ, r, (T ’ t) ,

Wt = CBS

n+m n

where CBS (·) is the Black Scholes formula.

47

7.2 Valuing warrants when observing the stock value

However, one does not necessarily observe the asset value of the ¬rm. Typically one only observes the equity

value of the ¬rm. If we let St be the current stock price, the asset value is really:

At = nSt + mWt

Using the stock price, one would value the warrant as

n nSt + mWt

, K, σ, r, (T ’ t)

Wt = CBS

n+m n

or

n m

CBS St + Wt , K, σ, r, (T ’ t)

Wt =

n+m n

Note that this gives the value of Wt as a function of Wt . One need to solve this equation numerically to ¬nd

Wt .

The numerical solution for Wt is done using the Newton-Rhapson method. Let

n m

g(Wt ) = Wt ’ CBS St + Wt , K, σ, r, (T ’ t)

n+m n

Starting with an initial guess for the warrant value Wto , the Newton-Rhapson method is that one iterates as

follows

g(Wti’1 )

Wti’1

Wti ’

= ,

g (Wti’1 )

where i signi¬es iteration i, until the criterion function g(Wti’1 ) is below some given accuracy . In this case

m

g (Wt ) = 1 ’ N (d1 )

m+n

where

St + m Wt

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

ln n

K 2

√

d1 =

σ T ’t

An obvious starting value is to set calculate the Black Scholes value using the current stock price, and

m

multiplying it with m+n .

Code 7.1 implements this calculation.

7.3 Readings

McDonald [2002] and Hull [2003] are general references. A problem with warrants is that exercise of all

warrants simultaneously is not necessarily optimal.

Press et al. [1992] discusses the Newton-Rhapson method for root ¬nding.

48

#include "fin_recipes.h"

#include "normdist.h"

#include <cmath>

double warrant price adjusted black scholes(const double& S, // current stock price

const double& K, // strike price

const double& r, // interest rate

const double& sigma, // volatility

const double& time, // time to maturity

const double& m, // number of warrants outstanding

const double& n){ // number of shares outstanding

const double epsilon=0.00001;

double time sqrt = sqrt(time);

double w = (n/(n+m))*option price call black scholes(S,K,r,sigma,time);

double g = w’(n/(n+m))*option price call black scholes(S+(m/n)*w,K,r,sigma,time);

while (fabs(g)>epsilon) {

double d1 = (log((S+(m/n))/K)+r*time)/(sigma*time sqrt)+0.5*sigma*time sqrt;

double gprime = 1’(m/n)*N(d1);

w=w’g/gprime;

g = w’(n/(n+m))*option price call black scholes(S+(m/n)*w,K,r,sigma,time);

};

return w;

};

Code 7.1: Adjusted Black Scholes value for a Warrant

A stock is currently priced at S = 48. Consider warrants on the same company with exercise price K = 40

and time to maturity of six months. The company has n = 10000 shares outstanding, and has issued

m = 1000 warrants. The current (continously compounded) risk free interest rate is 8%. Determine the

current warrant price.

The program

void test warrant price adjusted black scholes(){

double S = 48; double K = 40; double r = 0.08; double sigma = 0.30;

double time = 0.5; double m = 1000; double n = 10000;

double w = warrant price adjusted black scholes(S,K,r,sigma, time, m, n);

cout << " warrant price = " << w << endl;

};

provides the output

warrant price = 10.142

Example 7.1: Example warrant pricing

49

Chapter 8

Extending the Black Scholes formula

Contents

8.1 Adjusting for payouts of the underlying. . . . . . . . . . . . . . . . . . . . . . . 50

8.1.1 Continous Payouts from underlying. . . . . . . . . . . . . . . . . . . . . . . . . . . 50

8.1.2 Dividends. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

8.2 American options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

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

8.3 Options on futures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

8.3.1 Black™s model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

8.4 Foreign Currency Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

8.5 Perpetual puts and calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

8.6 Readings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

8.1 Adjusting for payouts of the underlying.

For options on other ¬nancial instruments than stocks, we have to allow for the fact that the underlying

may have payouts during the life of the option. For example, in working with commodity options, there is

often some storage costs if one wanted to hedge the option by buying the underlying.

8.1.1 Continous Payouts from underlying.

The simplest case is when the payouts are done continuously. To value an European option, a simple

adjustment to the Black Scholes formula is all that is needed. Let q be the continuous payout of the

underlying commodity.

Call and put prices for European options are then given by formula 8.1, which are implemented in code 8.1.

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

where

S

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

ln K 2

√

d1 =

σ T ’t

√

d2 = d1 ’ σ T ’ t

S is the price of the underlying secrutity, K the exercise price, r the risk free interest rate, q the (continous) payout 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.

Formula 8.1: Analytical prices for European call option on underlying security having a payout of q

Exercise 5.

The price of a put on an underlying security with a continous payout of q is:

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

1. Implement this formula.

50

#include <cmath> // mathematical library

// this de¬nes the normal distribution

#include "normdist.h"

using namespace std;

double option price european call payout( const double& S, // spot price

const double& X, // Strike (exercise) price,

const double& r, // interest rate

const double& q, // yield on underlying

const double& sigma, // volatility

const double& time) { // time to maturity

double sigma sqr = pow(sigma,2);

double time sqrt = sqrt(time);

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

double d2 = d1’(sigma*time sqrt);

double call price = S * exp(’q*time)* N(d1) ’ X * exp(’r*time) * N(d2);

return call price;

};

Code 8.1: Option price, continous payout from underlying

8.1.2 Dividends.

A special case of payouts from the underlying security is stock options when the stock pays dividends. When

the stock pays dividends, the pricing formula is adjusted, because the dividend changes the value of the

underlying.

The case of continuous dividends is easiest to deal with. It corresponds to the continuous payouts we have

looked at previously. The problem is the fact that most dividends are paid at discrete dates.

European Options on dividend-paying stock.

To adjust the price of an European option for known dividends, we merely subtract the present value of the

dividends from the current price of the underlying asset in calculating the Black Scholes value.

#include <cmath> // mathematical library

#include <vector>

// de¬ne the black scholes price

#include "fin_recipes.h"

double option price european call dividends( const double& S,

const double& K,

const double& r,

const double& sigma,

const double& time to maturity,

const vector<double>& dividend times,

const vector<double>& dividend amounts ) {

double adjusted S = S;

Copyright Design by: Sunlight webdesign