Detection Algorithm¶
For each completed 1-minute candle the algorithm evaluates two conditions to decide whether it should be flagged as buy-heavy or sell-heavy.
Rolling averages¶
The mean buy volume and mean sell volume are computed over the previous 20 candles (roughly 20 minutes of trading).
Warmup period
At least 5 candles of history are required before any signal is produced. This is why you won't see markers in the very first few minutes after market open.
The first (09:30 ET) and last (15:59 ET) candles of the regular session are always excluded from the imbalance check — they almost invariably carry outsized volume and would flood the chart with noise.
Buy-heavy condition¶
A candle is flagged ▲ B when both of the following are true:
- Buy volume significantly exceeds the 20-minute rolling average of buy volume
- Buyers dominated sellers in that minute (buy volume > sell volume)
Sell-heavy condition¶
A candle is flagged ▼ S when both of the following are true:
- Sell volume significantly exceeds the 20-minute rolling average of sell volume
- Sellers dominated buyers in that minute (sell volume > buy volume)
Why both conditions?¶
Requiring both conditions simultaneously filters out misleading prints. A high-volume candle where both sides are active equally is just noise — a signal only fires when volume is elevated and clearly one-sided. This combination tends to coincide with institutional order flow rather than retail churn.
High-volatility days
On news-driven days (FOMC, CPI, earnings) the rolling average adjusts upward within a few minutes, so the threshold self-corrects. You may still see more signals than usual on high-volatility days, but they reflect genuinely outsized flow.