I Engineered a Real-Time Options Flow Scanner — Here's What 'Smart Money' Actually Looks Like
Suneet Malhotra
Apr 12, 2026
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:
| Source | Cost/mo | Delay | Quality |
|---|---|---|---|
| Tradier API | $10 | 15 min | Good |
| Polygon.io | $29 | Real-time | Very Good |
| Unusual Whales API | $50 | Real-time | Excellent |
| CBOE DataShop | $200+ | Real-time | Institutional |
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
A Retry Is Not a Trading Decision
A rejected order is a decision. Retrying it without preserving the reason can turn a risk control into a duplicate trade.
Quantitative TradingThe Market Is Closed Is Not a Trading Rule
A backtest can know the exchange hours and still schedule a trade into a holiday, an early close, or a stale session. Calendar state is market data.
Career & Best PracticesThe Runbook Is Not the System
A documented fix is not a shipped fix. The difference is a control boundary: who can execute it, when, and what proves it happened.
Agentic AIThe Log Is Part of the Agent's Interface
An agent that can act but cannot leave a useful decision record is not autonomous. It is an opaque process with write access.
Latest Blog Posts
The Runbook Is Not the System
A documented fix is not a shipped fix. The difference is a control boundary: who can execute it, when, and what proves it happened.
A Retry Is Not a Trading Decision
A rejected order is a decision. Retrying it without preserving the reason can turn a risk control into a duplicate trade.
The Log Is Part of the Agent's Interface
An agent that can act but cannot leave a useful decision record is not autonomous. It is an opaque process with write access.
Related Tools & Demos
The QA Field Manual to Language Models
A free 24-chapter book. Start at “what is AI, really?” and finish with a small language model you built yourself — one that reads a failing Playwright test and proposes a fix you can run. Read it in your browser, or download the PDF or the Mac app.
View Source Code →Multi-Model LLM Harness
One interface to call any AI model — capability routing, fallback chains, budgets, circuit breakers, and a quality feedback loop. A practical architecture pattern write-up.
Automated Trading System
Multi-engine trading platform with real-time risk management, regime-based strategy selection, and automated order execution.
View Source Code →
Stay in the Loop
Get weekly insights on AI-driven QA, engineering leadership, and automation strategies.
No spam, ever. Unsubscribe anytime.