Home/Projects/Market Microstructure Alpha Detector
Prototype
Quantitative FinanceMarket MicrostructureAlgorithmic TradingReal-Time Systems

Market Microstructure Alpha Detector

Market microstructure alpha — signals derived from order flow, bid/ask dynamics, and trade initiation patterns — decays in minutes to hours. Most quantitative tools operate at daily resolution and miss these signals entirely. This project builds a real-time pipeline that ingests tick-level trade and quote data, computes microstructure features, and generates short-horizon signals for mean-reversion and momentum strategies.

recruiter perspective

Built a real-time market microstructure alpha detection system

  • ›Computes order flow imbalance, VPIN, and effective spread from live tick data
  • ›Volume-time bucketing for regime-stable feature computation
  • ›Real-time pipeline with automatic stale signal invalidation
View repo
Hiring Summary

A real-time microstructure signal detection pipeline computing order flow imbalance, VPIN, effective spread, and price impact from tick-level data. Uses volume-time bucketing and Lee-Ready trade initiation classification to produce short-horizon alpha signals with automatic stale signal expiry.

Short-horizon trading strategies require microstructure-level signals that daily OHLCV data cannot provide. Order flow imbalance, trade initiation classification, and effective spread dynamics contain predictive information at intraday horizons that most practitioners lack the infrastructure to process in real-time.

Challenges Addressed
  • Signal computation must run within one tick period to produce actionable signals
  • Trade initiation classification (Lee-Ready) requires access to the prevailing quote at trade time
  • Features must be computed incrementally without reprocessing full tick history
  • Signal decay must be tracked to avoid stale signals from previous liquidity regimes
◆Market Microstructure Alpha DetectorQUANTITATIVE FINANCE/visual-placeholder

Polygon.io WebSocket feed → tick parser (trade and quote streams) → feature engine (OFI, VPIN, effective spread, price impact) computed incrementally per volume bucket → signal generator (rolling z-score) → Redis signal store with TTL → FastAPI for signal consumption.

Stack
PythonNumPyPandasPolygon.ioFastAPIRedis
Decision
Volume-time bucketing over calendar-time bucketing
Calendar-time buckets have variable information density — a quiet minute has the same bucket size as a high-volume minute. Volume-time buckets contain constant information density, making features more stationary across market regimes.
Decision
Lee-Ready algorithm for trade initiation classification
Exchanges don't always report whether a trade was buyer or seller-initiated. Lee-Ready (trade at ask = buyer-initiated, at bid = seller-initiated, else tick rule) provides reliable classification without waiting for exchange-reported flags.
Tradeoff
Signal freshness vs. computational cost
Chose: Incremental feature updates with Redis TTL for stale signal expiry
Recomputing all features from scratch on every tick is too expensive for real-time use. Incremental updates maintain rolling state per feature; TTL expiry ensures stale signals are automatically invalidated after regime shifts.
01Multi-asset correlation: detect cross-asset order flow propagation for lead-lag signals
02Regime-conditional signal filtering: disable mean-reversion signals in trending regimes
03Execution simulator: backtest signal-to-fill latency given realistic market impact