Black-Scholes Documentation

Overview

The black_scholes function implements the Black-Scholes-Merton model, which is widely used to price European call and put options on non-dividend paying stocks. This model provides not only the option price but also key risk sensitivities ("Greeks"), including Delta, Gamma, Vega, Theta, and Rho.
The formula for the option pricing and the calculation of the Greeks depend on several factors including the current stock price (S), the strike price (K), time to expiration (T), the risk-free interest rate (r), and volatility (sigma).
The function returns a dictionary of the calculated option price and Greeks, rounded to two decimal places.

Key Assumptions of the Black-Scholes Model

Function Parameters

Explanation of Key Calculations

  1. d1 and d2: These values are intermediate variables used in the calculation of both the option price and the Greeks. They represent the standard deviations (adjusted by time) from the current price to the strike price under the lognormal assumption
    • \( d_1 = \frac{\ln\left(\frac{S}{K}\right) + \left(r + \frac{\sigma^2}{2}\right) T}{\sigma \sqrt{T}} \)
    • \( d_2 = \frac{\ln\left(\frac{S}{K}\right) + \left(r - \frac{\sigma^2}{2}\right)T}{\sigma \sqrt{T}} = d_1 - \sigma \sqrt{T}\)
  2. Option price:
    • \(c = S N\left(d_1\right) - Ke^{-rT} N\left(d_2\right)\)
    • \(p = Ke^{-rT} N\left(-d_2\right) - S N\left(-d_1\right)\)
  3. Greeks:
    • Delta measures the sensitivity of the option price to changes in the underlying asset price
      • \(delta_{call} = N\left(d_1\right)\)
      • \(delta_{put} = N\left(d_1\right)\) - 1
    • Gamma measures the sensitivity of Delta to changes in the underlying asset price
      • \(gamma = \frac{N\left(d_1\right)}{S\sigma\sqrt{T}}\)
    • Vega measures sensitivity to volatility
      • \(vega = \frac{S N\left(d_1\right)\sqrt{T}}{100}\)
    • Theta measures the sensitivity to time decay
      • \(theta_{ call} = - \frac{S N^{'}\left(d_1\right)\sigma}{2\sqrt{T}} - rKe^{-rT}N\left(d_2\right)\)
      • \(theta_{ put} = - \frac{S N^{'}\left(d_1\right)\sigma}{2\sqrt{T}} + rKe^{-rT}N\left(-d_2\right)\)
    • Rho measures sensitivity to the risk-free interest rate
      • \(rho_{call} = KTe^{-rT}N\left(d_2\right)\)
      • \(rho_{putt} = -KTe^{-rT}N\left(-d_2\right)\)