indicator · on price · open source
Volatility Stop indicator
Volatility Stop is a free open-source indicator by @deepwick. Volatility Stop is a self-correcting ATR trail: the stop ratchets in the direction of the… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Volatility Stop does
Volatility Stop is a self-correcting ATR trail: the stop ratchets in the direction of the trend and resets when the trend flips.
- Acts as a regime marker — the line flipping below price = trend up, flipping above = trend down.
- Tighter than Chandelier because it uses the ratchet rather than the raw rolling high.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Volatility Stop", overlay=true)
len = input.int(20, "ATR length", minval=1, maxval=200)
mult = input.float(2, "ATR multiplier", minval=0.5, maxval=10, step=0.1)
colorMid = input.color("color.orange", "Color Mid")
var float stop = na
atr = ta.atr(len)
prevStop = na(stop) ? close : stop
stop := close > prevStop ? math.max(prevStop - atr * mult, close - atr * mult) : math.min(prevStop + atr * mult, close + atr * mult)
p_Vol_Stop = plot(stop, "Vol Stop", color=colorMid, linewidth=2)
alertcondition(close > stop and close[1] <= stop[1], "Trend up", "Volatility Stop flipped to trend-up")
alertcondition(close < stop and close[1] >= stop[1], "Trend down", "Volatility Stop flipped to trend-down")
No comments yet.
Sign in to comment.