10.12.2019 Views

Python for Finance

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Exotic Options

European, American, and Bermuda

options

In Chapter 10, Options and Futures, we have learnt that for a European option, the

option buyer could exercise their right only on maturity dates, while for an American

option buyer, they could exercise their right any time before and on maturity

dates. Thus, an American option would be more valuable than its counterparty of

European option. Bermudan options could be exercised once or several times on a

few predetermined dates. Consequently, the price of a Bermudan option should be

between a European and an American option with the same features, such as the

same maturity dates and the same exercises prices, see the following two inequalities

for call options:

Here is an example for a Bermudan option. Assume that a company issues a 10-year

bond. After seven years, the company could call back, that is, retire, the bond at

the end of each year for the next three years. This callable property is eventually an

embedded Bermudan option with exercise dates in December of years 8, 9, and 10.

First, let's look at the Python program for an American call by using the binomial

model:

def binomialCallAmerican(s,x,T,r,sigma,n=100):

from math import exp,sqrt

import numpy as np

deltaT = T /n

u = exp(sigma * sqrt(deltaT))

d = 1.0 / u

a = exp(r * deltaT)

p = (a - d) / (u - d)

v = [[0.0 for j in np.arange(i + 1)] for i in np.arange(n + 1)]

for j in np.arange(n+1):

v[n][j] = max(s * u**j * d**(n - j) - x, 0.0)

for i in np.arange(n-1, -1, -1):

for j in np.arange(i + 1):

v1=exp(-r*deltaT)*(p*v[i+1][j+1]+(1.0-p)*v[i+1][j])

v2=max(v[i][j]-x,0)

# early exercise

v[i][j]=max(v1,v2)

return v[0][0]

#

s=40. # stock price today

[ 492 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!