開始使用免費開始

Black-Scholes 選擇權定價

選擇權是全球最常用來管理資產價格風險的「衍生性商品」。在這個練習中,你會用 Black-Scholes 選擇權定價公式,為 IBM 股票的歐式買權定價。IBM_returns 資料已載入你的工作環境。

你會先計算 IBM_returns 的波動率 sigma,也就是年化的標準差。

接著,你會使用為本題與後續練習所建立的 black_scholes() 函式,分別在兩種波動率水準下為選擇權定價:sigmasigma 的兩倍。

履約價 K(投資人有權利但無義務以該價格買進 IBM)為 80。無風險利率 r 為 2%,市場現價 S 為 90。

你可以在這裡找到 black_scholes() 函式的原始碼:here

本練習屬於課程

Python 量化風險管理

檢視課程

練習說明

  • 計算 IBM_returns 的波動率 sigma,也就是「年化」後的標準差(你已在第 1 章做過波動率年化)。
  • 使用提供的 black_scholes() 函式,當波動率為 sigma 時,計算歐式買權的 Black-Scholes 價格 value_s
  • 接著,當波動率改為 2 * sigma 時,求得 Black-Scholes 價格 value_2s
  • 顯示 value_svalue_2s,觀察當波動率「上升」時,選擇權價格如何變化。

動手互動練習

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

# Compute the volatility as the annualized standard deviation of IBM returns
sigma = np.sqrt(____) * IBM_returns.____

# Compute the Black-Scholes option price for this volatility
value_s = black_scholes(S = 90, X = 80, T = 0.5, r = 0.02, 
                        sigma = ____, option_type = "call")

# Compute the Black-Scholes option price for twice the volatility
value_2s = ____(S = 90, X = 80, T = 0.5, r = 0.02, 
                sigma = ____, option_type = "call")

# Display and compare both values
print("Option value for sigma: ", ____, "\n",
      "Option value for 2 * sigma: ", ____)
編輯並執行程式碼