開始使用免費開始

用選擇權進行避險

假設你持有一個只有 IBM 單一資產的投資組合。你要用「Δ 覆蓋」(delta hedging)與 IBM 的「歐式賣權(European put option)」來避險該投組的風險。

首先,使用 Black-Scholes 選擇權定價公式,評價這個歐式賣權。履約價 X 為 80,到期時間 T 為 1/2 年。無風險利率為 2%,現貨價格 S 「起初」為 70

接著,使用 bs_delta() 函式計算此選擇權的 delta,並用它來對抗股價下跌至 69.5 的「變動」,建立一個「Δ 中性」(delta neutral)的由選擇權與股票組成的投資組合。

black_scholes()bs_delta() 兩個函式已提供於你的工作環境中。

你可以在此處找到 black_scholes()bs_delta() 函式的原始碼:here

本練習屬於課程

Python 量化風險管理

檢視課程

練習說明

  • 計算現價為 70 時的歐式賣權價格。
  • 使用提供的 bs_delta() 函式,在現價 70 時求出該選擇權的 delta
  • 當現價下跌到 69.5 時,計算選擇權的 value_change
  • 驗證現貨價格變動與以 1/delta 權重加總的 value_change 之和接近 0。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Compute the annualized standard deviation of `IBM` returns
sigma = np.sqrt(252) * IBM_returns.std()

# Compute the Black-Scholes value at IBM spot price 70
value = black_scholes(S = ____, X = 80, T = 0.5, r = 0.02, 
                      sigma = sigma, option_type = "put")
# Find the delta of the option at IBM spot price 70
delta = bs_delta(S = ____, X = 80, T = 0.5, r = 0.02, 
                 sigma = sigma, option_type = "put")

# Find the option value change when the price of IBM falls to 69.5
value_change = ____(S = 69.5, X = 80, T = 0.5, r = 0.02, 
                             sigma = sigma, option_type = "put") - ____

print( (69.5 - 70) + (1/delta) * ____ )
編輯並執行程式碼