VIX spike detector
Marks one-minute bars where price jumps fast on heavy volume; rare at the default 8% threshold.
The indicator marks a bar when two tests pass together: the close is more than spike_threshold above the close lookback bars earlier, and that bar's volume is over 1.5 times the average over the last twice-lookback bars. Each marker sits on the close of a qualifying bar, and nothing else is drawn. The default 8% rise in 10 bars suits volatility products and is a high bar for most symbols.
How to read it
- Markers sit on the close of each qualifying bar. The indicator draws no line.
- A marker needs both a fast rise over the window and volume well above its recent average.
- At the default 8% threshold no marker appeared in a month of SPY one-minute bars, so loosen spike_threshold to see activity.
- A run of markers on consecutive bars means the push lasted several bars. A lone marker is a single burst.
What it outputs
- Spike marker
- The close price on each bar that rises more than the threshold over the window on above-average volume. Nothing is drawn on other bars.
When it fires
A bar whose close is more than spike_threshold above the close lookback bars earlier, on volume over 1.5 times its recent average. It means a fast push up backed by heavy trading. At the default 8% it did not happen once in a month of SPY one-minute bars.
Settings
- lookback
- Bars the price rise is measured over; the volume average covers twice as many. Longer windows let slower rises qualify, so markers come more often at the same threshold. Shorter windows need a sharper move in fewer bars.
- spike_threshold
- The minimum rise over the window, as a fraction (0.08 is 8%). Raising it demands a bigger rise and marks fewer bars. Lowering it marks more: at 0 any rise qualifies, and below 0 small falls qualify too. At 0 markers reached about 9% of bars.
Pitfalls
- The docstring says it returns True, but it returns the close price on spike bars and nothing otherwise, so markers sit at the close.
- At the default 8% it did not fire once in a month of SPY one-minute bars, so an empty chart usually means the threshold is too high for that symbol.
- The presets were tested on SPY only, so check them on the symbol you trade.