Skip to content

This program uses real-time data for the 3-Year Treasury Bill in order to find ATM implied volatility of a stock by using the Black-Scholes model to provide an accurate expected move.

Notifications You must be signed in to change notification settings

BonucciAndrea/BlackScholesExpectedMove

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Implied Volatility Calculator with Black-Scholes Model

This Python script calculates the implied volatility of both call and put options for a given stock using the Black-Scholes model. It also calculates the expected high and low price movement of the stock.

Dependencies

This script requires the following Python libraries: math pandas yfinance datetime. You can install these libraries using pip:

pip install pandas yfinance

Usage

To run the script, simply execute it with Python:

python3 main.py

When prompted, enter the symbol of the stock you want to analyze:

Stock symbol: AAPL

The script will then fetch the latest options data for the stock, calculate the implied volatility of the closest in-the-money call and put options, and calculate the expected high and low price movement of the stock.

Functions

The script includes the following functions:

black_scholes_volatility(S, K, T, option_price, option_type): Calculates the implied volatility using the Black-Scholes formula.

norm_cdf(x): Calculates the cumulative distribution function of the standard normal distribution.

norm_pdf(x): Calculates the probability density function of the standard normal distribution.

Disclaimer

This script is for educational purposes only. It should not be used for making real-world investment decisions. Always do your own research before investing in the stock market.

About

This program uses real-time data for the 3-Year Treasury Bill in order to find ATM implied volatility of a stock by using the Black-Scholes model to provide an accurate expected move.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages