indicator · on price · open source
ZigZag indicator
ZigZag is a free open-source indicator by @deepwick. ZigZag connects confirmed swing highs and swing lows with a line so you can see the… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What ZigZag does
ZigZag connects confirmed swing highs and swing lows with a line so you can see the market's actual swings free of noise.
- Lines redraw for
lenbars while a new pivot is forming, then settle. - Use to anchor Fibonacci retracements or to mark structural breakouts.
- Not predictive on its own — purely a visualisation of confirmed swings.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("ZigZag", overlay=true)
len = input.int(10, "Swing Length", minval=2, maxval=200)
colorUp = input.color("color.green", "Color Up")
colorDown = input.color("color.red", "Color Down")
pivHi = ta.pivothigh(high, len, len)
pivLo = ta.pivotlow(low, len, len)
p_ZZ_Hi = plot(pivHi, "ZZ Hi", color=colorUp, style=plot.style_linebr)
p_ZZ_Lo = plot(pivLo, "ZZ Lo", color=colorDown, style=plot.style_linebr)
plotshape(not na(pivHi), "Swing High", style=shape.labeldown, location=location.abovebar, color=colorUp, text="H")
plotshape(not na(pivLo), "Swing Low", style=shape.labelup, location=location.belowbar, color=colorDown, text="L")
No comments yet.
Sign in to comment.