Black-Scholes Option Pricing Model
The Black-Scholes model is a widely used framework in financial mathematics for pricing European options.
In this example, we will calculate the price of a European call option using the Black-Scholes formula.
Problem
Given:
- Stock price $(S)$
- Strike price $(K)$
- Risk-free interest rate $(r)$
- Time to maturity $(T)$
- Volatility $(\sigma)$ of the stock
Calculate the price of a European call option using the formula:
$$
C = S \cdot N(d_1) - K \cdot e^{-rT} \cdot N(d_2)
$$
$$
d_1 = \frac{\ln(S/K) + (r + \sigma^2 / 2)T}{\sigma \sqrt{T}}, \quad
d_2 = d_1 - \sigma \sqrt{T}
$$
Here, $N(x)$ is the cumulative distribution function ($CDF$) of the standard normal distribution.
Python Code
1 | import numpy as np |
Explanation
Parameters:
S: The current stock price varies from $50$ to $150$.K: The strike price is set at $100.$r: The risk-free interest rate is $5$%.T: Time to maturity is $1$ year.sigma: Volatility is $20$%.
Black-Scholes Formula:
d1andd2are intermediate terms used to calculate the option price.norm.cdf(d1)andnorm.cdf(d2)give the probabilities of the option being in-the-money.
Visualization:
- The $x$-axis represents the stock price.
- The $y$-axis represents the calculated call option price.
- A red dashed line indicates the strike price $(K = 100)$.
Results

- When the stock price $(S)$ is much lower than the strike price $(K)$, the call option price approaches zero because the option is out-of-the-money.
- As $(S)$ increases beyond $(K)$, the call option price increases, reflecting the intrinsic value of the option.
- The graph provides an intuitive understanding of how the call option price varies with the stock price, according to the Black-Scholes model.








