Quantitative Trading7 min read

I Engineered a Real-Time Options Flow Scanner — Here's What 'Smart Money' Actually Looks Like

S

Suneet Malhotra

Apr 12, 2026

1 views
I Engineered a Real-Time Options Flow Scanner — Here's What 'Smart Money' Actually Looks Like - Quantitative Trading blog post
🔧Python🔧Options Trading🔧Real-time Data🔧Unusual Activity🔧Market Microstructure🔧Quant Finance🔧Alerting Systems

I Engineered a Real-Time Options Flow Scanner — Here's What 'Smart Money' Actually Looks Like

In February 2026, two days before a major pharmaceutical company's FDA announcement, someone bought 4,000 out-of-the-money call options expiring that Friday. Premium paid: $280,000. The stock moved 40% on the approval. Those options returned $6.2M.

Was it insider trading? Maybe. Was it a pattern I could detect algorithmically before the move happened? Absolutely.

I've spent the last eight months building an options flow scanner that monitors unusual activity in real time, filters for the signals that historically precede large moves, and delivers alerts I can actually act on. Here's everything I learned.

Why Options Flow Is the Best Leading Indicator

Most retail traders watch price and volume. Institutional traders watch options flow first.

Here's why: options are asymmetric. If you have conviction about a directional move in the next 72 hours, buying options is dramatically more capital-efficient than buying stock. A $100K bet in OTM calls can return $2M if you're right. The same bet in stock returns $20K.

This asymmetry means that when someone with actual information — an insider, an analyst with early channel checks, a quant fund with a strong model — wants to position, they often do it in options. The footprint is smaller in notional terms but enormous in premium paid.

What "unusual" actually means:

  • Premium paid is 3x or more the average daily premium for that strike/expiry
  • Volume exceeds open interest (new positions, not closing trades)
  • Order comes in as a single block sweep (urgency — hitting multiple exchanges simultaneously)
  • Out-of-the-money with near-term expiry (high leverage, binary bet)

The Data Stack

Getting real-time options data is the expensive part. Here are the options, ordered by cost:

SourceCost/moDelayQuality
Tradier API$1015 minGood
Polygon.io$29Real-timeVery Good
Unusual Whales API$50Real-timeExcellent
CBOE DataShop$200+Real-timeInstitutional

I use Polygon.io for the options chain data and supplement with Unusual Whales' parsed flow for their pre-calculated "unusual" flags.

from polygon import RESTClient
from datetime import date, timedelta
import pandas as pd

client = RESTClient("YOUR_POLYGON_API_KEY")

def get_options_chain(ticker: str, dte_min: int = 0, dte_max: int = 30) -> pd.DataFrame:
    """Fetch options chain with volume and OI for a given ticker."""
    exp_from = date.today().isoformat()
    exp_to = (date.today() + timedelta(days=dte_max)).isoformat()

    contracts = []
    for opt in client.list_options_contracts(
        underlying_ticker=ticker,
        expiration_date_gte=exp_from,
        expiration_date_lte=exp_to,
        limit=250
    ):
        snapshot = client.get_snapshot_option(ticker, opt.ticker)
        if snapshot and snapshot.day:
            contracts.append({
                "ticker": opt.ticker,
                "strike": opt.strike_price,
                "expiry": opt.expiration_date,
                "type": opt.contract_type,
                "volume": snapshot.day.volume or 0,
                "open_interest": snapshot.open_interest or 0,
                "premium": (snapshot.day.volume or 0) * (snapshot.last_quote.ask or 0) * 100,
                "iv": snapshot.implied_volatility,
                "delta": snapshot.greeks.delta if snapshot.greeks else None,
            })

    return pd.DataFrame(contracts)

The Scoring Algorithm

Raw volume numbers are meaningless without context. A ticker that trades 10,000 option contracts daily showing 12,000 is normal. A ticker that averages 200 showing 12,000 is extraordinary.

I normalize everything against a 30-day rolling average:

def calculate_unusual_score(row: pd.Series, historical_avg: dict) -> float:
    """Score unusualness from 0-100."""
    ticker = row["ticker"]
    avg_volume = historical_avg.get(ticker, {}).get("avg_daily_volume", 1)
    avg_premium = historical_avg.get(ticker, {}).get("avg_daily_premium", 1)

    volume_ratio = row["volume"] / max(avg_volume, 1)
    premium_ratio = row["premium"] / max(avg_premium, 1)
    oi_ratio = row["volume"] / max(row["open_interest"], 1)

    # OTM bonus — OTM options are higher conviction bets
    moneyness_bonus = 1.5 if abs(row.get("delta", 0.5)) < 0.3 else 1.0

    # Near-expiry urgency bonus
    dte = (pd.to_datetime(row["expiry"]) - pd.Timestamp.today()).days
    urgency_bonus = 1.5 if dte <= 7 else 1.0

    raw_score = (
        volume_ratio * 0.35 +
        premium_ratio * 0.40 +
        oi_ratio * 0.25
    ) * moneyness_bonus * urgency_bonus

    # Normalize to 0-100
    return min(100, raw_score * 10)

Filtering for High-Signal Alerts

The raw scanner generates ~200 alerts per day across all tickers. I filter to 10-15 actionable ones using this criteria stack:

def is_high_conviction_flow(row: pd.Series) -> bool:
    """Return True only for the most institutionally significant flow."""
    return (
        row["unusual_score"] >= 65 and           # Well above normal
        row["premium"] >= 50_000 and              # Minimum $50K commitment
        row["volume"] > row["open_interest"] and  # New position, not closing
        row["type"] == "call" and                 # Directional bullish
        abs(row.get("delta", 0.5)) < 0.4 and      # OTM (conviction bet)
        row["dte"] <= 14                           # Short-dated (urgency)
    )

I also cross-reference against my news sentiment system (from my previous post). When unusual options flow AND bullish news sentiment fire on the same ticker within a 4-hour window, hit rate improves substantially.

Real Patterns I've Observed

After 8 months of live monitoring, here are the patterns that actually predict moves:

Pattern 1: The Pre-Earnings Sweep 3-5 days before earnings, large call sweeps at strikes 10-15% OTM. Happens consistently on tickers where analysts have revised estimates upward. Not every time, but more often than random chance.

Pattern 2: The FDA Whisper Biotech tickers see unusual OTM call volume 24-48 hours before FDA approvals. The premium paid is often institutional in size. I've learned to treat ANY unusual call sweep in biotech during a catalyst window as a high-alert signal.

Pattern 3: The Quiet Accumulation Large, patient buying of in-the-money calls over 3-4 days — not a single sweep but steady accumulation. Often precedes M&A announcements. The tell is consistent above-average flow with no obvious news catalyst.

Backtesting the Signals

I backtested 18 months of historical unusual flow data (from Unusual Whales' dataset) against 5-day forward returns. Honest results:

  • High-conviction signals (score ≥ 65): 54% hit rate on 5%+ move within 5 days
  • Very high-conviction (score ≥ 85): 61% hit rate
  • Pre-earnings sweeps specifically: 58% hit rate when combined with analyst estimate revisions
  • Biotech catalysts: 67% hit rate but high variance (FDA binary outcomes)

These numbers sound modest but consider: a 60% hit rate with a 3:1 reward/risk ratio (options leverage) is a strongly positive expected value system.

What I Got Wrong Initially

I chased every signal. The first month I alerted on everything with volume > 2x average. My phone wouldn't stop buzzing. I learned to narrow criteria ruthlessly — fewer, higher-conviction signals.

I ignored sector context. An energy sector ticker with unusual calls during an OPEC meeting week is less interesting than the same flow with no obvious macro catalyst. Context matters enormously.

I didn't track my misses. The scanner predicts moves but doesn't explain them. I should have been logging every signal outcome from day one. Now I have a feedback database that's making the model smarter.

The Infrastructure (Cheap Edition)

The whole system runs on a $12/month DigitalOcean droplet:

  • Python scanner process running every 5 minutes during market hours
  • PostgreSQL storing historical flow data and outcomes
  • Telegram bot for instant alerts (free)
  • Weekly automated report emailed via SendGrid ($0 on free tier)

Total cost: ~$65/month including data subscriptions.

The Honest Caveat

Options flow is a leading indicator, not a crystal ball. Most unusual activity has a mundane explanation — hedging, covered call rolls, institutional rebalancing. The signal-to-noise ratio is roughly 1-in-3.

What the system gives you is not certainty. It gives you an asymmetric edge — more of the right kind of attention, faster, with less noise. That's enough.

Follow @NewsQuantEdge for daily options flow highlights. Full code available on GitHub.

Share this post

You Might Also Like

Stay in the Loop

Get weekly insights on AI-driven QA, engineering leadership, and automation strategies.

No spam, ever. Unsubscribe anytime.