Paused
-
FVG
0
FVG Qual
0
Entries
0
TP Exits
0
EOD Exits
0
Price Action
Select a date to load data
Events Timeline
No events loaded
Strategy Results
Loading summary data...

SPY Scalping Bot

A quantitative intraday trading system that trades SPY options using a three-layer architecture: regime classification, gamma exposure context, and live fair value gap detection.

Layer 1: HMM Regime Classification

Uses Hidden Markov Models to classify the current daily market regime along two axes: volatility (HIGH_VOL / LOW_VOL) and direction (BULLISH / BEARISH). The combined regime (e.g. HIGH_VOL_BEARISH) determines which trade directions are enabled and their take-profit targets.

  • Volatility model — 2-state HMM with features: realized volatility, ATR relative, ATR momentum, VIX relative, VIX momentum
  • Direction model — 2-state HMM with features: SPY momentum, SPY MA relative, return momentum, price slope
  • All features are rolling z-score normalized with a 120-day window
  • Prediction uses a causal forward filter (no lookahead)

Layer 2: GEX Context

Pre-market gamma exposure analysis. Fetches the full SPY options chain, computes dealer gamma exposure per strike, and identifies key structural levels.

  • Call wall — Strike with maximum positive GEX (resistance)
  • Put wall — Strike with maximum negative GEX (support)
  • Gamma flip — Zero-crossing point where dealer positioning flips from long to short gamma
  • Strikes are categorized by relative magnitude: wall, major, minor, noise
  • Used for conviction scoring and wall-aware take-profit placement

Layer 3: Live FVG Trading Strategy

Streams 1-minute SPY bars during regular trading hours. Detects Fair Value Gaps, gates entries behind the Market Opening Process and cycle confirmation, then executes ATM options orders.

Market Opening Process (MOP)

The first 15 minutes of trading establish the MOP range (high/low). All entries are gated behind price breaking above MOP high (for CALL) or below MOP low (for PUT).

Cycle Activation

After MOP completes, the bot requires 6 consecutive bars above MOP high (CALL cycle) or below MOP low (PUT cycle) before any entries can be taken. VWAP acts as a dynamic threshold when price extends beyond the MOP range.

FVG Detection

A Fair Value Gap requires 3 consecutive bars where a gap forms between bar 0's high and bar 2's low (bullish) or bar 0's low and bar 2's high (bearish). Gaps are filtered by:

  • Gap size as percentage of price
  • Displacement strength
  • Volume score

Entry & Exit Logic

  • Entry — Qualified FVG + cycle armed + regime allows direction → ATM option order
  • Take-profit — Based on regime matrix TP percentage, adjusted by nearest GEX wall
  • EOD exit — All positions closed at 15:45 ET
  • Loss management — Options worth less than $0.20 or less than 5% of entry cost are held as lottery tickets

Regime Strategy Matrix

The regime determines which directions are enabled and the take-profit target. Key rule: never trade PUT when direction is BULLISH. A TP of 0% means hold to EOD.