Course Content
Introduction to Finance with Python
Introduction to Finance with Python
Black-Scholes Model
What is a Black-Scholes model?
After we've discovered some of the basic strategies for an option trading, it is time to discover one more important aspect in theory of options trading, which is a Black-Scholes Model.
Call Option Case
Here is an expression of this model, which computes price of a call contract:
Here t
- option's start time, S_t
- price of an asset at moment t
, K
- strike price, T
- moment of option's expiration, σ
- volatility of asset, r
- risk-free interest rate, N
- cumulative distribution function of a standard gaussian distribution.
Also, d_+
could be computed, using the next expression:
While d_-
is computed as follows:
Note also, that as long as in all expression present only T-t
, but not T
or t
separately, it all comes down to the point, where only length of time period matters, so we can assume that t=0
and use only T
, which now corresponds to the length of time period.
Here is a code implementation:
# Importing necessary libraries import numpy as np from scipy.stats import norm # Defining corresponding function `black_scholes_call` def black_scholes_call(S, K, T, r, σ): d_plus = (np.log(S / K) + (r + 0.5 * σ ** 2) * T) / (σ * T ** 0.5) d_minus = d_plus - σ * T ** 0.5 return S * norm.cdf(d_plus) - K * np.exp(-r * T) * norm.cdf(d_minus) # Defining all necesaary variables: starting price `S` equals 110, strike price `K` equals 100, length of period `T` is 9 month or 0.75 of a year, risk-free interest rate `r` is 0.04 and volatility `σ` is 0.15 S = 110 K = 100 T = 0.75 r = 0.04 σ = 0.15 # Printing estimated price print(black_scholes_call(S, K, T, r, σ))
Put Option Case
In case of Put contract, with a previously defined notation, the next expression is used:
Or, it can be rewrited in the next way, showing it's connection with corresponding call option's price:
Thanks for your feedback!