A Python-based tool that analyzes options data around earnings events, calculates volatility metrics (like IV30/RV30, ATR, and Yang-Zhang volatility), and provides Recommended, Consider, or Avoid labels based on user-defined criteria. The calculator includes a Tkinter GUI for Windows (or other OS), interactive candlestick charts, and multi-threaded earnings scanning.
Disclaimer: All information contained in this repository, including the source code and associated resources, is provided for educational and research purposes only. It does not constitute financial advice or recommendation of any investment strategy. Trading options carries significant risk. Always consult a licensed financial advisor before making any investment decisions.
Earnings Volatility Calculator leverages market data from Yahoo Finance and Investing.com to identify earnings events, retrieve option chains, and analyze a stock’s implied volatility (IV) relative to its historical or realized volatility (RV). It assigns a recommendation based on volume, IV/RV ratios, and implied volatility term structure slopes.
This project was inspired by research indicating that shorting volatility during earnings can provide an edge if specific conditions (e.g., high implied volatility, steep term structure) are met. The included GUI offers a user-friendly way to:
- Scan for upcoming earnings.
- Filter by timing (Pre/Post/During Market) and recommendation.
- View recommended setups.
- Generate a candlestick chart with a double-click.
-
Tkinter-Based GUI
- Table with sortable columns, color-coded rows, filtering options, and direct CSV export.
-
Proxy & Multi-Threaded Support
- Optional proxy rotation for fetching data.
- Concurrent requests for earnings scanning to speed up data collection.
-
Options Analysis
- Computes 30-day realized volatility (Yang-Zhang or fallback method).
- Fetches Implied Volatilities from ATM calls/puts.
- Builds a simple term structure to approximate IV at different expirations.
-
Recommendation Logic
- Recommended: Average daily volume ≥ 1,500,000 shares, IV30/RV30 ≥ 1.25, and term slope ≤ –0.00406.
- Consider: Partial overlap of conditions.
- Avoid: Fails key criteria or missing data.
-
Candlestick Charts
- Double-click a row to pop up a Matplotlib “candle” chart showing up to 1 year of price data.
This code is loosely based on the insights shared in the Volatility Vibes YouTube channel video, “This Option Strategy Turned $10k Into $1 Million In One Year”. The primary strategy revolves around selling implied volatility (IV) around earnings based on the observation that markets often overprice near-term earnings volatility.
Key points from the research:
- Term Structure & IV Overpricing
Earnings events concentrate uncertainty into near-term options, often causing implied volatility to spike and the term structure to invert (negative slope). - Volume Matters
Stocks with healthy trading volume (both shares and options) often see heightened demand for protection and speculative bets, leading to higher IV. - IV30 vs. RV30
When short-dated implied volatility is significantly higher than recent realized volatility, it may suggest overpricing. - Risk Management
Selling naked straddles can be highly profitable but also suffers large drawdowns; the referenced video suggests calendar spreads might offer a safer risk profile.
For a deep-dive into the underlying concepts, see the video transcript in the repository or the original YouTube link above.
- Operating System:
- Windows 10 or higher (also works on macOS / Linux with minor adjustments)
- Python:
- Version 3.7+; 3.10+ recommended
- Internet Connection:
- Required for fetching stock market data from Yahoo Finance and Investing.com
-
Install Python
- Download here and make sure to check “Add Python to PATH” during installation.
- macOS:
brew install python@3.10 python-tk@3.10
-
Open a Terminal / Command Prompt
- On Windows, press
Win + R, typecmd, and press Enter. - On macOS, press
Command + space, typeTerminal, and press Enter.
- On Windows, press
-
Clone or Download the Repository
git clone https://github.com/Acelogic/Earnings-Volatility-Calculator.git cd Earnings-Volatility-Calculator/src- Using python virtual environment:
- Windows
python -m venv venv source venv/bin/activate- macOS
python3.10 -m venv venv source venv/bin/activate -
Install Dependencies
pip install -r requirements.txt
-
Run the Application
python calculator.py
The Tkinter UI should open.
- Launch the GUI (
python calculator.py). - In the “Enter Stock Symbol” field (top panel), type the stock ticker (e.g.
AAPL). - Click “Analyze”.
- Select a date using the tkcalendar date picker.
- Click “Scan Earnings” to fetch a list of all US stocks with earnings on that date.
- Double‐click on any row in the table.
- A Matplotlib “candle” chart appears, showing approximately 1 year of price/volume history.
- Click “Export CSV” at the bottom-right of the GUI.
- Choose a file name and location.
-
Proxy Usage
- Enable or disable proxies via the “Enable Proxy” checkbox.
- Use “Update Proxies” to fetch a new list of free proxies.
-
Logging & Debug
- Debug logs are written to files (e.g.,
options_analyzer_debug.log).
- Debug logs are written to files (e.g.,
- “No module named tkcalendar”
- Install with
pip install tkcalendar.
- Install with
- No Internet Access or Proxy Failures
- Disable proxy in the GUI or verify you have a valid network connection.
- Missing Data or “N/A”
- Some stocks may lack options or have incomplete data.
Contributions, bug reports, and feature requests are welcome!
- Open an issue or create a pull request on GitHub.
This project is licensed under the MIT License.
-
Volatility Vibes Channel
This Option Strategy Turned $10k Into $1 Million In One Year -
Trade Tracker Template
Google Sheets link: Trade Tracker Template -
Further Reading
- Option Volatility & Pricing by Sheldon Natenberg
- Options as a Strategic Investment by Lawrence G. McMillan
Happy researching!