Volatility breakout signal
Draws no breakout markers at any setting: each close is tested against a range that already includes its own bar.
The indicator looks for a close outside its recent range, with a margin of half the average true range (ATR). The range is the highest high and lowest low over the last lookback bars, and that window already includes the current bar. It emits True for a close above the high plus the margin (the code calls it a buy) and False for a close below the low minus the margin (a sell). A close always lies between its own bar's high and low, so neither test can pass and the indicator never fires.
How to read it
- The chart draws no markers at default settings: on a month of SPY one-minute bars the indicator fired zero times.
- A marker could only appear on a bad bar whose close sits above its own high or below its own low, so treat any marker as a data error.
- The silence is not a volatility reading: nothing checks volatility, and the ATR only sets the margin.
What it outputs
- Breakout
- True marks an upside breakout (a buy in the code), False a downside breakdown (a sell). Neither is produced on valid bars.
When it fires
Only on a bad bar whose close sits above its own high (upside) or below its own low (downside). Valid bars cannot meet either test, so with real price data it never fires.
Settings
- atr_window
- Bars averaged into the ATR that sets the margin (half of it). Longer smooths the margin and reacts slowly to range changes; shorter tracks the last few bars. No setting draws a marker, so the chart looks the same at any value.
- lookback
- Bars in the high and low window the close must break. Longer raises the level the close must clear; shorter narrows it toward the current bar. The window includes the current bar, so no setting draws a marker.
Pitfalls
- The window includes the current bar, so the close is tested against a level its own bar already set. A breakout test normally compares with prior bars only.
- The docstring says it fires when volatility is high, but nothing checks volatility. The ATR only shifts the breakout level.
- Tuning the two parameters cannot make it fire, so the silence is a code defect, not a setting to adjust.