. Math 623 - Computational Finance Barrier option pricing using Finite Difference Methods (FDM) Pratik Mehta pbmehta@eden.rutgers.edu Masters of Science in Mathematical Finance Department of Mathematics, Rutgers University This paper describes the implementation of a C++ program to calculate the value of a european style call option and a discretely sampled up-and-out barrier option on an underlying asset, given input parameters for stock price (s=100), strike price (k=110),volatility (v=30%), interest rate (r=5%), maturity (T=1 year), U = 120 knock out usingclosed form solution, and Finite difference method. We compare the results of all these methods. The underlying stock price is assumed to follow geometric brownian motion. [2]. I. INTRODUCTION In this assignment we are pricing a European style vanilla call option and discretely monitored barrier option (t = 252) using closed form solution, and Finite difference method. ds(t) = (rs(t)dt + σs(t)dw (t) (1) the solution to the above Stochastic Differential Equation is, S(T ) = S(0)e (r 1 2 σ2 )T +σw (T ) the payoff for the call option is, (2) (S(T ) k) + (3) We also price an up-and-out barrier option. This can be represented by, II. (S(T ) k) + 1 maxs(t)<u (4) VANILLA CALL : CLOSED FORM BLACK-SCHOLES-MERTON Here, K is the strike price and S(T ) is the terminal stock price at the payoff date. The price of the underlying at terminal time,t, is given by [3] S(T ) = S(0)e (r a 1 2 σ2 )T +σw (T ) (5) A closed form solution for the price of a European Call and Put is given by [3] and c(t, x) = xe at N(d + (T, x)) e rt KN(d (τ, x)) (6) p(t, x) = e rt KN( d (T, x)) xe at N( d + (τ, x)). (7) Here, N is the Normal Cumulative Distribution density and the parameters, d + and d are given by d + = d + σ T = 1 [log σ xk (r T + + 12 ) ] σ2 T.(8) The closed form solution to the option is implemented in the file BlackScholesFormulas.cpp and the formula is given below The output is as follows, Closed form option price = 9.057 (9) III. BARRIER OPTIONS Barrier options are path-dependent options, with payoffs that depend on the price of the underlying asset at expiration and whether or not the asset price crosses a barrier during the life of the option. There are two categories or types of Barrier options: knock-in and knock-out. Knock-in or in options are paid for up front, but you do not receive the option until the asset price crosses the barrier. This Knock-in can be represented by, (S(T ) k) + 1 max(s(t)) U (10) Knock-out or out options come into existence on the issue date but becomes worthless if the asset price hits the barrier before the expiration date. If the option is a knock-in (knock-out), a predetermined cash rebate may be paid at expiration if the option has not been knocked in (knocked-out) during its lifetime. The barrier monitoring frequency specifies how often the price is checked for a breach of the barrier. All of the analytical models have a flag to change the monitoring frequency where the default frequency is continuous. Up-and-out options are represented as (S(T ) k) + 1 S(t)<U (11)
2 The closed form solution to the up and out barrier option is implemented in the file ClosedFormUpOutCall.cpp and the formula is given below C up = C(t, S(t)) S(t)e d(t t) N(x 1 ) + (12) ke r(t t) N(x 1 σ T t) + (13) S(t)e d(t t) N(x 1 )( H S(t) )2λ (N(y) N( y)) (14) ke r(t t) N(x 1 ( H S(t) )2λ 2 (N( y) σ T t) (15) The output is as follows, IV. N( y 1 σ T t) (16) Closed f orm option price = 0.0524 (17) NUMERICAL SOLUTION TO PDE USING FINITE DIFFERENCE METHOD There are many cases where the PDE cannot be analytically solved or the solution is very tedious. In these cases we can easily approximate the solution using numerical methods like Finite difference. Finite Difference Method generally seeks to approximate the solution to some PDE. Generally, the statement of a problem has two parts. Conditions: a Partial Differential Equation (PDE), boundary conditions, constraints, and so on. Data: initial values, final values (e.g. a payout function), boundary values, and so on. The Black and Scholes formula to calculate the value of an option is derived by solving the Black-Scholes partial differential equation: f f + rs t S + 1 2 σ2 S 2 2 f = rf, (18) S2 We can approximate the above PDE using Forward/Backward/Central difference. and u t u(x, t + t) u(x, t) t, (19) 2 u u(x + x, t) 2u(x, t) + u(x x, t) x2 x 2, (20) We can write the Black Scholes PDE using Finite difference as V k+1 i = A k i Vi 1 k + (1 + Bi k )Vi k + Ci k Vi+1 k (21) A = 1 2 (σ2 i 2 (r d)i)δt (22) B = (σ 2 i 2 + r)δt (23) C = 1 2 (σ2 i 2 + (r d)i)δt (24) The algorithm to compute the finite difference solution is given below[6] Divide the solution space into 2D mesh (25) F or i = 0 to asstetsteps (26) S(i) = i assetsteps (27) V (i, 0) = CallP ayoff(s(i)) (28) Define A B and C (29) next i (30) F or k = 0 to timesteps (31) F or i = 0 to asstetsteps (32) V k+1 i = A k i Vi 1 k + (1 + Bi k )Vi k + Ci k Vi+1 k (33) next i (34) V (0, k + 1) = 0 (35) VI k = IδS Strike e ( rkδt) (36) next k (37) We use the above algorithm to price a call option, F inite Difference call option price = 9.077 (38) To price the up-and-out barrier option, we have to do a couple of changes, The first change is that we have to reduce the number of asset steps so that the value becomes 0 for any price above U. And the second is the boundary condition, the upper boundary at S=120, the value of the option is forced to be 0. F inite Difference barrier option price = 0.056 (39) V. ANSWER TO THE QUESTIONS Q1 We have used explicit finite difference and we found that when the time steps T=252 and Space intervals N=50, the value of the vanilla and barrier options are in agreement to the closed form solutions. But explicit FD method has some disadvantages. First of all, the method does not converge and is stable all the time. The convergence and stability depends on the value of T (Time intervals) and N (Space intervals). Also there is a dependence of δt and δs on each other. They cannot be independently varied.paul WIlmott shows that for convergence and stablity the following conditions should me met, and δs 2a b (40) δt 1 σ 2 I 2 (41)
3 Using the above conditions we find that, δt 230 (42) We have tried a combination of step sizes to test robustness of the stability and convergence criteria. We calculated the option prices for various δt and δs. We varied δt from 100 to 500 and δs from 2 to 30. We find that the results blow up when δt is less than 200 (approx) and when δs is greater than 50. We have tabulated the results (below). Q2 If we vary S max, we also inadvertently change δs, if we increase S max without adjusting δs, we get inaccurate answers. Both of them will have to vary accordingly. In out C++ code, we varied S max and kept δs constant. We find that for δs = 4, S max 240 blows the answer. We have tabulated the results. VI. BENCHMARKING We have used many spreadsheet based models to benchmark our results. The summary go the benchmarking is given below and is also tabularised below. We have used Excel spreadsheets by Haug and Black and Numerix to price. The benchmarked results are in agreement with the results obtained from C++. The results are, N umerix option price vanilla = 9.08 (43) Numerix up in andout = 0.05 (44) Haug vanilla call = 9.05 (45) Haug up and out call = 0.05 (46)
4 TABLE I: Vanilla and Asian Call pricing using Methods for S(0)=100 and K=110 Option Closed Form Finite Difference Haug Numerix European Vanilla Call 9.05 9.07 9.057 9.08 Barrier (Up-and-out) Call 0.052 0.056 0.05 0.05 TABLE II: Effect of varying δs Strata size Vanilla Call Barrier call 4 9.077 0.056 5 9.043 0.045 10 8.95 0.0074 20 9.05 0.076 30 5.62 0.0079 60 0.94 0.002 TABLE III: Effect of varying δt Strata size Vanilla Call Barrier call 100 1.5e+027 0.067 200 9.078 0.058 300 9.076 0.055 400 9.075 0.0538 500 9.074 0.0529 TABLE IV: Effect of varying S max S max Vanilla Call Barrier call 140 9.05 0.05 180 9.10 0.056 200 9.077 0.0564 240 9.06 0.056 300-4.7e+059 0.0564
5
FIG. 2: Barrier 6
[1] wwwthep.physik.uni-mainz.de/ stefanw/download/lecture [2] M.S. Joshi, C++ design Patterns and Derivative Pricing, (Wiley 2008). [3] S.E. Shreve, Stochastic Calculus for Finance II Continuous Time Models, (Springer, 2004). [4] Wikipedia page for low discrepancy sequence [5] I M Sobol, USSR comp. Math [6] Jonathan Goodman,Courant Institute of Mathematical Science, NYU [7] www.cecs.csulb.edu/ ebert/teaching/lectures/552/ [8] rss.acs.unt.edu/rdoc/library/fexoticoptions [9] rss.acs.unt.edu/rdoc/library/fexoticoptions/latex/barrieroptions 7