Black and Scholes model - All you need to know (with Python example!)
Overview, variables, assumptions, formula, python code, criticism and limitations
Black and Scholes model is very often first contact with financial modelling and is absolutely on must to know basis, it is simple and determines foundation for many derivates models. In this post I will go through all you need to know about Black and Scholes model
The Black-Scholes Model: An Overview
The Black-Scholes model is a financial model that has become widely used for valuing options contracts. It was developed by Fischer Black and Myron Scholes in 1973, and has since been refined by numerous other academics and practitioners. The model uses a series of inputs to calculate the fair value of an option, which can be used to determine whether the option is overpriced or underpriced. In this article, we'll take a closer look at the Black-Scholes model, including its inputs, assumptions, and practical uses. Next up I will present the formula as well as ready function in Python which you can use in calculating fair value with use of that model. Finally, I’ll also examine some of the criticisms and limitations of the model which you need to keep in mind. Remember it is only for educational purposes, it’s not investment advice!
That being said let’s dive right in into the very core of Quant Finance!
Black-Scholes Model variables
The Black-Scholes model uses five variables to calculate the fair value of an option: the current stock price, also called spot price (St), the exercise/strike price (K), the time to expiration (T), the risk-free interest rate (r), and the volatility of the underlying stock (σ). Let's take a closer look at each of these inputs.
Current stock price (St): This is the current market price of the stock underlying the option. The higher the stock price, the higher the value of a call option (the right to buy the stock at a predetermined price), and the lower the value of a put option (the right to sell the stock at a predetermined price).
Exercise price (K): This is the predetermined price at which the option can be exercised. The higher the exercise price, the lower the value of a call option, and the higher the value of a put option.
Time to expiration (T): This is the length of time until the option expires. The longer the time to expiration, the higher the value of both call and put options.
Risk-free interest rate (r): This is the rate of return on a risk-free investment, such as a US Treasury bond. The higher the risk-free interest rate, the higher the value of a call option, and the lower the value of a put option.
Volatility (σ): This is a measure of the stock's price fluctuations over time. The higher the volatility, the higher the value of both call and put options.
Assumptions of the Black-Scholes Model
The Black-Scholes model is based on a number of assumptions:
The stock price follows a lognormal distribution: This means that the stock price is more likely to move a certain amount in percentage terms than in absolute terms.
There are no dividends paid during the life of the option: This assumption allows for simpler calculations, but can result in inaccurate valuations if dividends are in fact paid.
The risk-free interest rate and volatility are constant: This assumption can also lead to inaccurate valuations if the interest rate or volatility changes over the life of the option.
There are no transaction costs: This assumption is also made to simplify the calculations, but in reality there are always transaction costs associated with buying or selling options.
Practical Uses of the Black-Scholes Model
The Black-Scholes model is used in a variety of ways in finance, including:
Option valuation: The Black-Scholes model can be used to determine the fair value of an option, which can help investors decide whether to buy or sell the option.
Risk management: The Black-Scholes model can be used to measure the sensitivity of an option's value to changes in its inputs, which can help investors manage their risk exposure.
Option pricing: The Black-Scholes model can be used to price options for trading, which can help market makers determine the bid and ask prices for the options.
Black and Scholes Model formula:
Formula:
C=SN(d1)−Ke−rtN(d2)
where:
d1=σstlnKS+(r+2σv2)t
and
d2=d1−σst
and where:
C=Call option price
S=Current stock (or other underlying) price
K=Strike price
r=Risk-free interest rate
t=Time to maturity
N=A normal distribution
Black and Scholes function in Python:
Here’s python code which you can plug right in and use on any data you need!
Check out this code on my GitHub here! Greeks calculator, which we will tackle in different occasion.
#import packages
import numpy as np
from scipy.stats import norm
#Variables
"""
k = strike price
st = spot price
r = risk free rate
t = maturity
vol = volitality
"""
k = 350
st = 360
r = 0.0329
t = 240/365
vol = 0.30
#create a function, type C=call, P=put
def BSM(st,k,r,t,vol, type="C"):
d1 = (np.log(st/k) + (r+(vol**2/2))*t)/(vol*np.sqrt(t))
d2 = d1 - vol*np.sqrt(t)
try:
if type == "C":
price = norm.cdf(d1,0,1)*st - norm.cdf(d2,0,1)*k*np.exp(-r*t)
elif type == "P":
price = -st*norm.cdf(-d1,0,1) + norm.cdf(-d2,0,1)*k*np.exp(-r*t)
except:
print('Check the type')
print('Black and Scholes fair price is: ',price)
#Test
BSM(600,599.4,0.0077,115/365,0.1697, type="C")
And there you have it, feel free to copy and paste to try it out on your own!
Criticism and Limitations:
Despite its widespread use in finance, the Black-Scholes model has been subject to criticism from academics and practitioners alike. One major criticism of the model is its assumption that stock price movements follow a lognormal distribution. In reality, stock price movements often exhibit fatter tails than a lognormal distribution would predict, meaning that extreme events occur more frequently than the model would suggest. This can lead to inaccurate valuations of options and other derivatives, as the model may not adequately capture the risk of these extreme events.
Another criticism of the Black-Scholes model is its assumption that volatility is constant over the life of the option. In reality, volatility can change significantly over time, particularly in times of market stress. This can lead to inaccurate valuations of options and other derivatives, as the model may not adequately capture the increased risk of these events. Some practitioners have attempted to address this issue by using alternative models that incorporate time-varying volatility, such as the GARCH model. However, these models can be more complex and computationally intensive than the Black-Scholes model, which can make them less practical for some applications.
Conclusion
Black and Scholes model is definitely marvelous invention and is indisputable foundation for all derivates theory, understating this concept will help you move forward in your journey in Financial Modelling. If you wish to see more fundamental concept of Quantitative Finance please check my very first post on Substack:
Financial Markets Theory – Introduction to Fundamental Concepts of Quantitative Finance
Next up we will have a look for Stochastic Calculus for Quantitative Finance which is closely connected with Monte Carlo Simulation and many other powerful techniques which I hope we will master together!
Subscribe this blog and get quick, informative Quant Insights to develop skills you need to grow ahead of your competition in this fast paced and exiting field!
All the best!
Tomasz