Up to now, we have discussed that options are really path-independent, which means the option prices depend on terminal values. Thus, before pricing such an option, we need to know the terminal stock prices. To extend the previous program, we have the following code to estimate the terminal stock prices for a given set of values: S0
(initial stock price), n_simulation
(number of terminal prices), T
(maturity date in years), n_steps
(number of steps), mu
(expected annual stock returns), and sigma
(volatility):
import scipy as sp import matplotlib.pyplot as plt from scipy import zeros, sqrt, shape #input area S0 = 9.15 # stock price at time zero T =1. # years n_steps=100. # number of steps mu =0.15 # expected annual return sigma = 0.2 # volatility (annual) sp.random.seed(12345) # fix those random numbers n_simulation = 1000 # number of simulation...