Non Repaint ZigZag Arrow Indicator: Confirmed Pivots Only

Written by Dominic Walsh · Published · Last updated

The non repaint zigzag arrow indicator solves the problem every zigzag has: the last leg keeps moving. Here a pivot only counts once the bars on both sides of it have printed. ZigZag draws the line, and ZigZag BUY and ZigZag SELL mark the confirmed turns.

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 3: ZigZag, ZigZag BUY, ZigZag SELL
Alerts popup, push notification, email, sound
Inputs 12

What the Non repaint zigzag arrow Indicator draws on the chart

ZigZag joins the confirmed pivots into the familiar line, when ShowZigZagLine stays on.

ZigZag BUY marks a confirmed swing low.

ZigZag SELL marks a confirmed swing high.

Nothing prints on the newest bars, because their pivots cannot be confirmed yet.

  • ZigZag: section, gold, width 2
  • ZigZag BUY: arrow, dodger blue, width 2, arrow code 233
  • ZigZag SELL: arrow, orange red, width 2, arrow code 234
EURUSD H1: the non repaint zigzag arrow indicator marking a confirmed ZigZag BUY at a swing low.
EURUSD H1: the non repaint zigzag arrow indicator marking a confirmed ZigZag BUY at a swing low.

How the Non repaint zigzag arrow Indicator calculates its values

A symmetric pivot window

A bar counts as a swing high when its high is strictly the highest across the window running Depth bars either side of it. A swing low is the mirror.

Symmetric is the important word. Checking both sides is what makes the pivot final, and it is also why the newest Depth bars can never carry one.

The leg distance filter

Deviation sets a minimum distance from the previous pivot, measured in points. A candidate that sits too close to the last one gets discarded.

That stops the line zigzagging on tiny moves, which is what turns a raw pivot scan into a readable structure.

Backstep and the scan range

Backstep prevents two pivots of the same type appearing within a few bars of each other, keeping the alternation clean.

MaxBars caps how much history the scan covers at 1500 bars, and ArrowOffsetPts spaces each marker from its candle.

How to read the signals

A marker appears Depth bars after the turn it identifies, which is the price of confirmation.

The line between confirmed pivots does not move once drawn.

A larger Depth finds fewer and more significant swings, and delays each one further.

The newest part of the chart always carries unconfirmed structure, by design.

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

Alerts cover popup, push, email and sound when a pivot confirms. A bar time check keeps it to one alert per closed bar.

Every Non repaint zigzag arrow Indicator input

Core settings

Setting What it does Default
Depth pivot window (bars left & right). Depth is how many bars either side a pivot has to beat. It defaults to 12, which is wide and finds significant swings. 12
Deviation min leg distance (points). Deviation is the minimum distance in points from the previous pivot, 5 by default. 5
Backstep min bars between alternating pivots. Backstep stops two same-type pivots appearing too close together, 3 by default. 3

Display settings

Setting What it does Default
ArrowOffsetPts arrow offset from high/low (points). ArrowOffsetPts spaces a marker from its candle, 15.0 points by default. 15.0
ShowZigZagLine toggle line on/off. ShowZigZagLine draws the connecting line and defaults to true. on

Alert settings

Setting What it does Default
MaxBars analysis depth (0 = all bars). MaxBars caps how much history the scan covers, 1500 by default. 1500
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
Inputs panel for the non repaint zigzag arrow indicator showing Depth, Deviation and Backstep.
Inputs panel for the non repaint zigzag arrow indicator showing Depth, Deviation and Backstep.

Settings that fit your chart

The screenshot uses EURUSD H1. A twelve bar symmetric window finds swings worth marking on H1 and above. On M5 even that width qualifies pivots inside ordinary noise, and the twelve bar confirmation delay becomes a large fraction of the move. Raising Depth helps on fast charts.

When the Non repaint zigzag arrow Indicator fails

Confirmation costs Depth bars. By the time a marker appears the swing it identifies is well behind you.

A standard zigzag repaints precisely because it shows the unconfirmed leg. Removing that makes the tool honest and also removes the part traders watch most.

Deviation is a fixed point figure, so what counts as a meaningful leg does not scale with volatility.

Nothing rates one pivot against another. A minor swing that clears the filters marks the same as a major one.

Copy the compiled Non repaint zigzag arrow 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.

Background reading on the method behind the Non repaint zigzag arrow Indicator: Third market on Wikipedia, Keltnerchannel at Investopedia.

Download the Non repaint zigzag arrow Indicator for MT4 and MT5

The zip holds the compiled Non repaint zigzag arrow 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

Why does Depth 12 leave the newest bars empty?

Because a pivot is confirmed across a symmetric window. A bar has to beat every neighbour Depth bars on both sides, and the bars to its right have not printed yet on the newest part of the chart. That gap is the honest cost of never repainting.

Does the ZigZag line ever redraw once a leg is set?

No. A standard build draws the current leg to whatever the latest extreme happens to be and redraws it as that extreme moves. This one refuses to place a pivot until both sides confirm it, so nothing already drawn ever changes.

What does Deviation 5 filter out?

Candidate pivots sitting within five points of the previous one. Without that filter the line would zigzag on tiny moves and the structure would be unreadable. Because it is a fixed point figure, it needs adjusting on instruments that move very differently.

Does raising Depth make the tool better?

It makes it more selective and slower. A wider symmetric window finds fewer and larger swings, which is usually an improvement on a fast chart. The cost is that each confirmation waits that many more bars, so the markers arrive later still.

Are results guaranteed?

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

Category: this is part of our Support and Resistance collection. 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