The generic ATR flip-stop — a trailing line that ratchets behind price and switches sides when crossed, and the common ancestor of SuperTrend and the Chandelier Exit.
A Volatility Stop is a trailing stop line placed a multiple of Average True Range (ATR) away from price, on the opposite side of the assumed trend. While price holds above the line, the stop sits below price and can only move up; if price closes through it, the stop 'flips' to the other side and begins trailing downward instead. The concept traces to J. Welles Wilder's volatility system, and it is the root of a whole family tree: SuperTrend is a volatility stop with a band-based centerline and specific flip rules, and the Chandelier Exit is the same ratcheting ATR offset anchored to the highest high or lowest low rather than to close. Understanding this one mechanism — an ATR offset plus a one-way ratchet plus a flip condition — effectively explains all three. A volatility stop is a stop-placement and trend-state bookkeeping method, not a prediction engine: the line describes where price has been relative to its recent range, and a flip records that a threshold was crossed, nothing more. This is educational material, not financial advice, and no exit method removes the risk of loss inherent in trading.
Each bar, the indicator computes an offset of multiplier × ATR (commonly 2 × 14-period ATR). In an up state, the candidate stop is close − offset, but the plotted stop is the maximum of that candidate and the previous stop — the ratchet. This one-way rule is the part most naive implementations miss: without it, the stop would loosen every time volatility expanded or price dipped, defeating the purpose of a trailing stop. The stop therefore only rises (or holds) while the up state persists. When a bar closes below the stop, the state flips to down, and the stop re-initializes at close + offset, from which it can only move down until price closes above it. Because the current bar's close can cross and re-cross the line intrabar, honest implementations evaluate the flip only on confirmed bars — otherwise the flip marker appears and disappears in real time, and any alert built on it repaints. Variants differ in details: Wilder's original used significant closes, the Chandelier Exit anchors the offset to the highest high/lowest low of the lookback, and SuperTrend derives its centerline from hl2. All share the same skeleton: ATR offset, one-way ratchet, close-through flip.
ATR length 14 with a multiplier of 2.0 is a typical starting point; multipliers around 3.0 produce a looser stop with fewer flips, and shorter ATR lengths make the offset more reactive to recent bars. There is no correct setting: tighter parameters exit sooner and whipsaw more, looser parameters give back more before flipping. The trade-off can be measured on past data, but a setting that minimized whipsaw historically carries no guarantee forward.
//@version=6
indicator("Volatility Stop", overlay = true)
atrLen = input.int(14, "ATR Length", minval = 1)
mult = input.float(2.0, "ATR Multiplier", minval = 0.1, step = 0.1)
offset = mult * ta.atr(atrLen)
var bool uptrend = true
var float stop = na
if na(stop)
stop := close - offset
else if uptrend
if close < stop
uptrend := false
stop := close + offset
else
stop := math.max(stop, close - offset)
else
if close > stop
uptrend := true
stop := close - offset
else
stop := math.min(stop, close + offset)
flipUp = uptrend and not uptrend[1] and barstate.isconfirmed
flipDown = not uptrend and uptrend[1] and barstate.isconfirmed
plot(stop, "Volatility Stop", color = uptrend ? color.teal : color.red, style = plot.style_cross)
plotshape(flipUp, "Flip Up", style = shape.triangleup, location = location.belowbar, color = color.teal, size = size.tiny)
plotshape(flipDown, "Flip Down", style = shape.triangledown, location = location.abovebar, color = color.red, size = size.tiny)Pro tip: Judge any volatility-stop implementation by two details: whether the ratchet is truly one-way (the stop must never loosen within a state), and whether flips are evaluated only on confirmed bars (an intrabar flip that can un-happen will repaint every signal and alert built on it). Then remember what the tool is: a mechanical exit-placement method that trades whipsaw against giveback — not a system, and not a forecast. Educational content only, not financial advice; all trading involves risk of loss.
Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.