LINEBURG

 << Пред. стр. страница 7(всего 20)ОГЛАВЛЕНИЕ След. стр. >>
while (price < option price) {
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. 

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.

McDonald  and Hull  are general references. A problem with warrants is that exercise of all
warrants simultaneously is not necessarily optimal.
Press et al.  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 ) {