Skip to content

loujacob66/options-flow-analyzer

Repository files navigation

Options Flow Analyzer

Python 3.8+ License: MIT CI

A powerful command-line tool designed to help traders and analysts interpret options market activity by aggregating and visualizing option volume, open interest, and estimated dollar flow.

🚀 Key Feature: Advanced Sweep Detection - Filter out institutional noise to reveal true retail sentiment!

Features

Core Analysis

  • 📊 Query options data by ticker and expiration
  • 💰 Calculate net estimated dollar flow (volume × premium × 100)
  • 🎯 Strike and expiration breakdowns
  • 🔍 Identify unusual activity (high volume/OI ratios)
  • 🎯 Max pain analysis

🚀 Advanced Features

  • 🔥 Sweep Detection: Automatically identify and filter institutional sweep trades
  • 🎨 Rich CLI Display: Beautiful tables and analysis with color coding
  • 📦 Multiple Data Sources: Support for Polygon.io, Yahoo Finance, and more
  • 🎭 Demo Mode: Test the tool with sample data (no API key required)

Filtering & Analysis

  • Filter by expiration date, minimum volume, and option type
  • Compare analysis with and without sweep trades
  • Trade classification (Retail, Block, Sweep)
  • Sentiment analysis (Bullish/Bearish indicators)

Installation

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt

🚀 Quick Start

Try the Demo (No API Key Required)

# Run demo with sample data
python -m options_analyzer demo

# Demo with specific ticker and volume filter
python -m options_analyzer demo AAPL --min-volume 100

Real Data Analysis

  1. Get a free API key from Polygon.io
  2. Create a .env file:
    POLYGON_API_KEY=your_api_key_here
  3. Run analysis:
    python -m options_analyzer analyze SPY

Usage Examples

# Basic analysis with sweep detection
python -m options_analyzer analyze SPY

# Filter by minimum volume and disable sweep detection
python -m options_analyzer analyze AAPL --min-volume 100 --no-sweeps

# Show only calls with specific expiration
python -m options_analyzer analyze TSLA --option-type calls --expiration 2024-01-19

# Check configuration
python -m options_analyzer config

# Show help
python -m options_analyzer --help

Example Output

📈 Options Flow Summary
┏━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┓
┃ Metric ┃ Calls ┃  Puts ┃   Net ┃
┡━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━┩
│ Volume │ 14,742│ 10,516│  4,226│
│ Flow   │  $8.5M│  $5.8M│ $2.7M │
└───────┴───────┴───────┴───────┘

Sentiment: 🟢 Bullish | P/C Ratio: 0.71

🔍 Sweep Detection: 3 sweeps (6.1%) detected and filtered

Project Structure

options-flow-analyzer/
├── options_analyzer/
│   ├── __init__.py
│   ├── cli.py           # CLI interface
│   ├── data_fetcher.py  # Data fetching from APIs
│   ├── analyzer.py      # Core analysis logic
│   ├── display.py       # Output formatting
│   └── config.py        # Configuration
├── tests/
├── requirements.txt
└── README.md

Requirements

  • Python 3.8+
  • Internet connection for API calls

About

Advanced options flow analysis tool with sweep detection

Resources

License

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages