Volume surge detector
Marks bars whose volume runs above 2.5 times the recent average; it does not check price direction.
For each bar, the indicator divides the bar's volume by the average volume of the window minus 1 bars before it, so the current bar is not part of its own baseline. A bar is marked when that ratio is above 2.5, a threshold fixed in the code. The docstring says surges often come before explosive moves, but the code checks volume alone, so a surge on a falling bar is marked just like one on a rising bar.
How to read it
- Markers sit on the candles where volume spiked. Quiet bars draw nothing, and there is no line or scale.
- A marker means this minute traded well above the recent norm. It says nothing about direction.
- Check the candle itself for which way price moved, since the indicator ignores price.
- No markers appear until the window of bars has filled at the start of the chart.
What it outputs
- Volume surge
- Marked on a bar when its volume is above 2.5 times the average of the bars before it in the window. Off on every other bar.
When it fires
When the bar's volume is more than 2.5 times the average of the bars before it in the window. It flags a one-minute volume burst. It says nothing about price, so the burst can come on a rally, a sell-off or a flat bar.
Settings
- window
- Bars in the volume average, with the current bar left out of it. Longer smooths the baseline over more history. Shorter tracks the last few minutes, so a recent burst raises the bar a surge must clear. At 1 the code divides by zero; use 2 or more.
Pitfalls
- The docstring claims surges often precede explosive moves, but the code never looks at price. Treat a marker as a volume event, not a forecast.
- At defaults the signal is on for about 10.6 percent of SPY one-minute bars and starts about 82 separate surges per trading day, so markers are frequent, not rare.
- The 2.5 threshold cannot be changed from the chart, and window 1 divides by zero, so the lowest setting errors out.