Академический Документы
Профессиональный Документы
Культура Документы
第七組
PV
>>請輸入利率(r):0.1
請輸入期數(n):3
請輸入第 1 期現金流:10
Outcome 請輸入第 2 期現金流:10
請輸入第 3 期現金流:110
PV=100
是否繼續(Y/N)?N
Black-Scholes formula
設定變數 C:買權價格,P:賣權價格,S0:標的資產現貨價格,X:選擇權的履約價格,r:無風險利率,T:
到期日,sigma:股價報酬的波動性。將以上變數帶入 Black-Scholes formula,最後得出買權價格 C 為
8.9160,賣權價格 P 為 6.9359。
function blackscholes()
cont='Y';Y='Y';N='N'; % Continuous Execution
while cont == 'Y'
Code S0=input('Please enter the current stock price (S0): ');
X=input('Please enter the strike price (X): ');
r=input('Please enter the risk-free rate (r): ');
T=input('Please enter the time to maturity (T): ');
sigma=input('Please enter the volatility of returns of the
underlying asset (sigma): ');
d1=(log(S0/X)+(r+sigma^2/2)*T) / (sigma*sqrt(T));
d2=d1-(sigma*sqrt(T));
C_str=num2str(C);
P_str=num2str(P);
disp(['Call Premium = ',C_str]);
disp(['Put Premium = ',P_str]);
>> blackscholes
Please enter the current stock price (S0): 100
Please enter the strike price (X): 100
Please enter the risk-free rate (r): 0.02
Please enter the time to maturity (T): 1
Outcome
Please enter the volatility of returns of the underlying asset
(sigma): 0.2
Call Premium = 8.916
Put Premium = 6.9359
Continue (Y/N)?
Graphs of options
function plotoptions()
X = 50; % The strike price
c = 2; % The option premium
St = 40:0.05:60; % The range of the price of the underlying asset
Outcome