Order flow imbalance
๐ฟ Buddingยท last tended 09 Feb 2026quanttradingsignals
Order flow imbalance (OFI) measures the net pressure hitting the book: aggressive buys minus aggressive sells over a short window. The intuition is simple โ when liquidity is being consumed far more on one side, the mid-price tends to move that way before it fully reprices.
I built an OFI signal engine in Rust for prediction-market trading, consuming exchange WebSocket trade streams for a handful of assets and computing imbalance in real time. The hard parts were never the maths:
- Latency budget. A signal that's right but late is a loss. The engine is a multi-task async runtime so feeds, signal, and execution don't block each other.
- Edge decays. OFI is a fleeting effect; size it with Kelly criterion discipline and respect that the edge can vanish between backtest and live.
- Prove it first. Forward-test against live quotes before risking anything โ validate before automating.
A signal is a hypothesis about expected value. Treat it like one.