https://github.com/t-kalv/black-scholes-model
Implementation of the Black-Scholes Model for Europen option call/put pricing with features including calulating option prices based on mark parameters, estimating implied volatility , live data using Yahoo Finance API and visualising option prices against different factors...
https://github.com/t-kalv/black-scholes-model
black-scholes-equation black-scholes-model black-scholes-model-application european-call implied-volatility option-pricing quant quantitative-finance quantitative-trading streamlit streamlit-webapp trading trading-algorithms yahoo-finance yahoo-finance-api
Last synced: 7 months ago
JSON representation
Implementation of the Black-Scholes Model for Europen option call/put pricing with features including calulating option prices based on mark parameters, estimating implied volatility , live data using Yahoo Finance API and visualising option prices against different factors...
- Host: GitHub
- URL: https://github.com/t-kalv/black-scholes-model
- Owner: T-Kalv
- Created: 2025-04-27T11:28:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-15T21:33:25.000Z (over 1 year ago)
- Last Synced: 2025-06-15T23:03:28.958Z (over 1 year ago)
- Topics: black-scholes-equation, black-scholes-model, black-scholes-model-application, european-call, implied-volatility, option-pricing, quant, quantitative-finance, quantitative-trading, streamlit, streamlit-webapp, trading, trading-algorithms, yahoo-finance, yahoo-finance-api
- Language: Python
- Homepage:
- Size: 168 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Black-Scholes Option Pricing Model








## About:
### Basic Black-Scholes Algorithm
- provides theoretical estimate of the price of European call/put option
### Formula:
- $ S $ = current price of stock
- $ K $ = strike price of the option
- $ T $ = time to maturity in years
- $ r $ = risk-free interest rate
- $ \sigma $ = volatility of stock (the standard deviation of returns)
### European Call Option:
$$C = S \cdot N(d_1) - K e^{-rT} \cdot N(d_2)$$
### European Put Option:
$$P = K e^{-rT} \cdot N(-d_2) - S \cdot N(-d_1)$$
Where:
$$d_1 = \frac{\ln(S/K) + \left(r + \frac{\sigma^2}{2}\right) T}{\sigma \sqrt{T}}$$
$$d_2 = d_1 - \sigma \sqrt{T}$$
$$N(d) = \text{cumulative distribution function of the standard normal distribution}$$
### Newton Raphson (Implied Volatility):
- $ f(\sigma) = \text{BlackScholes}(\sigma) - \text{MarketPrice} = 0 $
- $$\sigma_{\text{new}} = \sigma - \frac{f(\sigma)}{f'(\sigma)} = \sigma - \frac{\text{BlackScholes}(\sigma) - \text{MarketPrice}}{\text{Vega}(\sigma)}$$
- $ \text{Vega}(\sigma) = \text{rate of change of BlackScholes option price wrt changes in volatility } \sigma $
### Option Greeks:
- Delta ($ \Delta $) = measures price sensitivity to underlying:
- Call option: $ \Delta $ ranges from 0 to 1
- Put option: $ \Delta $ ranges from -1 to 0
- Gamma ($ \Gamma $) = measures rate of change of delta
- Vega ($ \nu $) = measures sensitivity to volatility
- Theta ($ \Theta $) = measures sensitivity to time decay
- Rho ($ \rho $) = measures sensitivity to interest rates
### Formula for Option Greeks:
- For Calls:
$$\Delta = N(d_1)$$
- For Puts:
$$\Delta = N(d_1) - 1$$
- where $ N() $ is the standard normal cumulative distribution function
-
- $$\Gamma = \frac{N'(d_1)}{S \sigma \sqrt{T}}$$
- where $ N'(d_1) $ is the standard normal probability density function
-
- $$\nu = S \sqrt{T} N'(d_1)$$
## Tasks:
- Implement basic Black Scholes Algotithm
- Read options list from a csv file and ouput the call and put option price using the black scholes algorithm
- Implement implied volatility where we reverse the black sholes algo given a market option price find out what the implied volatility value is
- Visualise Option Prices using matplotlib such as option price vs stock price, option price vs strike price, option price vs volatility, option price vs time to maturity
- Implement simple Steamlit app that shows these results
- Add real time market data integration using Yahoo Finance API to retrieve real-world stock data
- Add a SQL database backend to store and export user stock option queries



