Volume acceleration surge
A volume spike over its recent average, on a bar where price is rising and volume has been building.
VolumeAccelerationSurge fires when three tests pass on the same bar: its volume is at least surge_threshold times the average volume of the window-1 bars before it, its close is more than 0.2% above the close two bars earlier, and the newest three bars' volume averages more than 1.3 times the oldest three in the window. The 0.2% and 1.3 figures are fixed in the code. A firing bar outputs the volume ratio times one plus the two-bar gain; any other bar outputs nothing.
How to read it
- Markers sit on the candles where all three tests passed on that bar; there is no line or pane.
- A marker means volume spiked while price rose over the last two bars. It says nothing about what price did afterward.
- Markers are rare at defaults: 11 bars in 7 separate runs over the default SPY sample month, so most of the chart stays empty.
What it outputs
- Volume surge
- Marked on each bar where volume is at least surge_threshold times the prior average, the close is over 0.2% above two bars earlier, and the newest three bars average over 1.3 times the oldest three in the window.
When it fires
Fires on a bar where all three tests pass: volume at least surge_threshold times the prior average, a close over 0.2% above two bars earlier, and newer volume over 1.3 times older volume in the window. It marks a volume spike with a short rise behind it. On the default SPY month: 11 bars in 7 runs.
Settings
- window
- Bars in the volume baseline and the acceleration check (default 10). Raising it smooths the baseline and moves the oldest-three comparison further back; lowering it reacts faster. At 2 or 3 nothing fires; at 1 the Python code raises ZeroDivisionError.
- surge_threshold
- Minimum volume ratio against the prior average (default 2.0, meaning twice). Raising it keeps only bigger spikes; lowering it admits smaller ones. At 0 or below the volume test passes on every bar.
Pitfalls
- Rare at defaults: 7 separate runs in a month of SPY one-minute bars, about one every three days. Lower surge_threshold to see more.
- Markers show only that the tests passed, not how big the spike was. The indicator's value, the volume ratio times one plus the two-bar gain, is not drawn.
- Windows 2 and 3 never fire, and window 1 raises ZeroDivisionError in the Python code. Keep window at 4 or more.