Let C = C(S, t) be the Black Scholes value of a European Vanilla Call. Use equation (1) and the MatLab function ‘European Call.m’ to plot C versus S for 0 ≤ S ≤ 200. The Excercise price is E = 100 and the Expiry date is T = 1. (a) Assume that r = 0.05 and σ = 0.3. Plot the value of C(S, t) at different values of t between t = 0 and t = T. Explain the limit of C(S, t) as t → T.
时间: 2024-01-14 14:04:55 浏览: 101
black_scholes_test.rar_The Test_black scholes
To plot C versus S for 0 ≤ S ≤ 200, we can use the following MatLab code:
```matlab
E = 100; % Exercise price
T = 1; % Expiry date
r = 0.05; % Risk-free interest rate
sigma = 0.3; % Volatility
S = linspace(0, 200, 1000);
C = zeros(size(S));
for i = 1:numel(S)
C(i) = EuropeanCall(S(i), E, r, sigma, T);
end
plot(S, C);
xlabel('S');
ylabel('C');
title('European Call Option Price');
```
This code first defines the parameters of the option, and then generates a range of values for S between 0 and 200 using the `linspace` function. For each value of S, the code calculates the option price using the `EuropeanCall` function (which can be obtained from various sources). Finally, the code plots the option price as a function of S using the `plot` function.
To plot the value of C(S, t) at different values of t between t = 0 and t = T, we can modify the above code as follows:
```matlab
E = 100; % Exercise price
T = 1; % Expiry date
r = 0.05; % Risk-free interest rate
sigma = 0.3; % Volatility
S = linspace(0, 200, 1000);
t = linspace(0, T, 1000);
C = zeros(numel(S), numel(t));
for i = 1:numel(S)
for j = 1:numel(t)
C(i, j) = EuropeanCall(S(i), E, r, sigma, T - t(j));
end
end
surf(S, t, C);
xlabel('S');
ylabel('t');
zlabel('C');
title('European Call Option Price');
```
This code generates a grid of values for S and t using `linspace`, and then calculates the option price for each combination of S and t using a nested loop. The option price is stored in a matrix `C`, and is plotted as a surface using the `surf` function.
As t approaches T, the option price converges to the intrinsic value of the option, which is max(S - E, 0) for a call option. This is because as the expiry date approaches, the option has less time to move in the money, and its time value decreases.
阅读全文