Double Zigzag No Repaint Indicator: Two Depths, Confirmed Pivots

Written by Dominic Walsh · Published · Last updated

Most ZigZag tools move their last leg as new bars arrive. The double zigzag no repaint indicator refuses to place a pivot until bars on both sides of it have confirmed the extreme, so a printed leg stays printed. Two depths run at once: a fast one at 8 bars for the detail and a slow one at 24 for the larger structure.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 4: Fast ZigZag, Slow ZigZag, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 9

What the Double Zigzag No Repaint Indicator draws on the chart

Fast ZigZag joins the shallow pivots with a dodger blue section line.

Slow ZigZag traces the deeper swings in orange red, drawn thicker so the two never get confused.

Buy places a lime arrow where the fast line turns up off a confirmed low.

Sell places a red arrow at a confirmed fast high.

  • Fast ZigZag: section, dodger blue, width 2
  • Slow ZigZag: section, orange red, width 3
  • Buy: arrow, lime, width 2, arrow code 233
  • Sell: arrow, red, width 2, arrow code 234
Double zigzag no repaint indicator on EURUSD H1 with fast and slow swing lines
Double zigzag no repaint indicator on EURUSD H1 with fast and slow swing lines

How the Double Zigzag No Repaint Indicator calculates its values

Confirming a pivot on both sides

IsConfirmedHigh takes the candidate’s high as pivot, then walks outward. It returns false the moment high[i-k] beats it on the newer side, or high[i+k] beats it on the older side. IsConfirmedLow applies the same test to lows. Checking both flanks is what removes the repaint: the answer cannot change once those bars exist.

Running the same test at two depths

Both lines share one routine and differ only in the depth passed in. `FastDepth` at `8` gives a responsive skeleton, `SlowDepth` at `24` a coarser one. warmup takes MathMax(FastDepth, SlowDepth) + 2 so neither line starts before it has room to confirm anything.

Placing the arrows off the fast line

Arrows follow the fast ZigZag only. The code checks whether FastBuf[i] matches the bar’s own high or low, using MathAbs against _Point * 0.5 as the tolerance, since comparing two doubles for equality is unreliable. A match at the high writes SellBuf, a match at the low writes BuyBuf, each `ArrowOffsetPts` clear of the candle.

How to read the signals

The two lines agreeing on a turn is a stronger read than the fast line turning alone.

Arrows come from the fast line, so the slow line will often have no marker at its own pivots.

Confirmation costs bars. The most recent swing has no line yet, and that gap is the honest price of not repainting.

The slow line staying flat through several fast swings is the tool telling you those swings sit inside a bigger leg.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

Four channels are available: popup, push notification, email and sound, each switched beneath `EnableAlerts`. Only popup is on by default; push, email and sound need turning on, and `SoundFile` names the clip. Because pivots confirm on closed bars, the guard’s one message per bar is rarely tested.

Every Double Zigzag No Repaint Indicator input

Core settings

Setting What it does Default
FastDepth Fast ZigZag depth (bars to confirm pivot). Bars either side needed to confirm a fast pivot, default `8`. Lower it for more detail and more arrows. 8
SlowDepth Slow ZigZag depth (bars to confirm pivot). The same for the slow line, default `24`. Keep a clear gap between the two or the lines track each other. 24

Display settings

Setting What it does Default
ArrowOffsetPts Arrow offset (points) from price. Gap between candle and arrow, default `30` points. 30

Alert settings

Setting What it does Default
EnableAlerts (see inputs panel) on
EnablePopup (see inputs panel) on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile (see inputs panel) alert.wav
Double zigzag no repaint indicator inputs: FastDepth, SlowDepth and ArrowOffsetPts
Double zigzag no repaint indicator inputs: FastDepth, SlowDepth and ArrowOffsetPts

Settings that fit your chart

Two depths need a chart with enough swing structure to separate them, which suits H1 and H4 on the majors. EURUSD H1 is the reference capture, where a depth of 24 covers about a day. On M5 both lines confirm quickly but the slow leg loses meaning as structure. On the daily chart a 24-bar confirmation delay is over a month, so expect the recent end of the line to stay empty for a long time.

When the Double Zigzag No Repaint Indicator fails

Not repainting means confirming late. The current leg is always missing, and by the time a pivot appears price has moved well past it.

In a tight range both lines confirm pivots that carry no structural meaning, and the fast arrows come thick and fast.

The equality tolerance of half a point can miss a pivot on instruments quoted with unusual precision, since the buffer value and the bar extreme must line up within that window.

Copy the compiled Double Zigzag No Repaint Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Download the Double Zigzag No Repaint Indicator for MT4 and MT5

The zip holds the compiled Double Zigzag No Repaint Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What makes this a no repaint ZigZag?

The confirmation rule. IsConfirmedHigh and IsConfirmedLow require that no bar on either side beats the candidate within the depth window. Once those bars exist the verdict is fixed, so a printed pivot never moves. Ordinary ZigZag tools place a provisional pivot immediately and revise it, which is where repainting comes from.

Why is the newest part of the Fast ZigZag line missing?

Because the confirmation needs `FastDepth` bars on the newer side, which is `8` by default. Until those eight bars print, the code cannot rule out a higher high appearing. That gap is the direct cost of the no repaint rule, and every genuinely non-repainting swing tool has it.

Do the Buy arrows follow SlowDepth as well?

No. Arrows come from the fast line only. The code tests FastBuf[i] against the bar’s high and low and writes SellBuf or BuyBuf on a match. The slow line at `SlowDepth` provides context for the bigger structure and never generates a marker of its own.

How far apart should FastDepth and SlowDepth be?

Far enough that they describe different structure. The defaults of `8` and `24` sit at a three to one ratio, which keeps the slow line visibly coarser. Move them closer together and the two lines start confirming the same pivots, which leaves you with one skeleton drawn twice.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Double Zigzag No Repaint Indicator as one input. Always backtest before trading live.

Category: this is part of our Support and Resistance collection. Also, truly, browse more Support and Resistance for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment