Pricing Up-and-Out Calls with Finite-Difference Black–Scholes Methods
Summary
This question describes a local-volatility model for a stock and asks how to price an up-and-out call by solving the Black–Scholes partial differential equation. The example specifies a barrier, strike, spot price, rates, maturity, and a volatility function that varies with both price and time. It proposes explicit, implicit, and Crank–Nicolson finite-difference schemes, and identifies the barrier condition as the part that complicates adapting a European-call implementation.
The payoff is zero if the stock reaches the barrier before maturity; otherwise it is the ordinary call payoff. The author’s attempted conditional payoff check is presented as an unsuccessful effort, not as a validated method. The document provides no numerical prices, convergence study, code, or comparison of the three schemes, so it serves as a problem statement rather than a worked solution. A complete implementation would need to enforce the knockout condition throughout the pricing domain and handle the boundary conditions consistently.
Key ideas
- An up-and-out call pays the vanilla call payoff only when the underlying stays below the barrier through maturity.
- The example uses a local-volatility surface that depends on both stock price and time.
- The question proposes explicit, implicit, and Crank–Nicolson finite-difference schemes for the pricing PDE.
- A terminal payoff check alone does not demonstrate how to enforce the barrier condition over the option’s life.
- No implementation, computed price, or numerical comparison is supplied.
Tags
Full text
# Pricing Knock Out Barrier Options by solving Black Scholes PDE (MATLAB)
# Pricing Knock Out Barrier Options by solving Black Scholes PDE (MATLAB)
> This question is based on MATLAB functions.
Suppose there is a stock S following the process
### $dS_t=(r-q)S_tdt+\sigma(S_t,t)dW_t$
r - risk-free rate, q - dividend yield, W - Weiner process
The Local Volatility Surface has been given
### $\sigma(S,t)=0.25.e^{-t}(100/S)^\alpha$
Option Price $V(S,t)$ being given as
### $\frac{\delta V}{\delta t}+\frac{1}{2}\frac{\delta^{2}V}{\delta S^{2}}\sigma(S,t)^{2}S^{2}+(r-q)S\frac{\delta V}{\delta S}-rV=0$
We are supposed to use Explicit, Implicit and Crank-Nicholson Finite Difference schemes respectively to solve for the option price. However, as you can see, this is a barrier call option.
The barrier being B = £130.
$S_0=$ £ 100, $K=$ £ 100, $r=$ 3% i.e the risk-free-rate
$q=$ 5% the dividend yield, time to maturity $T=$ 0.5, $\alpha$ in the local volatility function = 0.35
The pay-off function is given as
## $h_{up-and-out{call}}(S_T)= max(S_T-K,0),\; if \;max_{0\leq{t}\leq{T}}S_t<B$ .
### {0 in other cases}
My attempt
> I present my thought process here. I already have the Matlab code related to solving European Call option using the above three iteration methods described. In summary, I am unable to code the barrier option. I provide a picture below what I am aiming for.
- The stock price is a random variable varying with time, the maturity date for options is 0.5; i.e $t\in[0,0.5]$
- It is easier to solve when the $\sigma$ is a fixed value, here being a r.v. has made it difficult.
- I have tried adding the if-else condition to a usual European Call pricing code, however it is giving me back error.
- We need to modify the boundary condition to fit to that of barrier option (maybe)
I tried adding the following piece of code to the script below in link.
```
if S<=B
Vold = max(S-K,0)
else
Vold = 0
end
```
I am uploading a sample code for pricing european call. Click here to access the code
Since the question is bigger than what can be explained here, I would like to discuss it with the community first and then move forward with discussion.
Thank YouShown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.