Regime volatility surge
Scores 0 to 5 how hard price spread and volume jump together; on SPY one-minute bars it stays at 0 by default.
RegimeVolatilitySurge looks at the last window bars (20 by default) and takes two ratios. The first is the standard deviation of the closes divided by their average, which is how far price levels spread around the mean. The second is the current bar's volume divided by the average volume over the same window. It returns the highest level from 1 to 5 whose two thresholds both hold, or 0 when none do.
How to read it
- The line sits in its own pane below the price and moves only in whole steps from 0 to 5.
- Flat at 0 is the normal state. On the sampled SPY one-minute bars at default settings it never leaves 0.
- A step up needs the price spread and the current volume to pass that level's thresholds on the same bar.
- A step flags that something moved; the level carries no up or down sign, so check the candles for direction.
What it outputs
- Surge level
- Surge level from 0 (none) to 5 (extreme), in whole steps only. It rises when the close spread and the current bar's volume both pass that level's thresholds.
Settings
- window
- Bars the spread and average volume cover. Longer windows let closes spread further, so the score can rise, but the spread still has to clear 2% to score at all. A window of 1 is always 0 because one close has no spread.
Pitfalls
- The 2% spread threshold is hard-coded and window is the only input. Over the sample month the closes spanned about 3.3% low to high, so level 1 almost never trips on SPY one-minute bars.
- The spread is of price levels, not percent returns, so a steady drift raises it even when each bar is calm. A rising score can mean a trend, not an explosive move.
- Volume is only half the test. A volume spike with a flat price spread leaves the output at 0.