Volatility panic
Scores panic selling 0 to 5 from an ATR spike, a drop and a volume surge; it read 0 on a month of SPY at defaults.
VolatilityPanic rates each bar from 0 to 5 for panic selling. A level needs three tests at once: the current ATR divided by an average ATR input (the expansion), the close below the close two bars back (the drop), and this bar's volume divided by the average of the last five bars (the surge). Level 1 needs an expansion above 1.3 and a drop above 1%; level 5 needs an expansion above 2.5, a drop above 4% and a surge above 2.0, and the highest level whose tests all pass is shown.
How to read it
- The line sits in its own pane below the price and reads 0 on a calm bar.
- Any value above 0 marks a bar that passed that level's rule. Higher levels need a bigger drop and ATR ratio, and from level 2 on a volume surge.
- Each value judges only the last few bars, so a flagged bar is one moment in a sell-off, not a trend call.
What it outputs
- Panic level
- 0 on a calm bar; 1 to 5 for the highest level whose tests all pass on that bar.
Pitfalls
- On SPY one-minute bars from 1 Sep to 1 Oct 2026 it read 0 on every bar it could score, so no bar reached even level 1 and the pane looks flat.
- The drop compares the close with the close two bars back, so it spans two one-minute steps despite the three-bar name in the code.
- High and low never enter the math; they only decide whether a bar gets a value. atr_avg has no default, so the reading depends on the average ATR it is given.