Channel Zig Zag Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

The channel zig zag indicator builds a corridor out of swing points. Take the last swing high and low, and use that distance as the channel height. The rails then hold their place unless a new swing moves them meaningfully, which stops the corridor jittering on every bar.

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: Upper Channel, Lower Channel, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 11

What the Channel Zig Zag Indicator draws on the chart

Two rails and two marks on price.

`Upper Channel` runs dodger blue at width 2.

`Lower Channel` runs orange red beneath it.

`Buy` uses arrow 233 in lime.

`Sell` uses arrow 234 in red.

Marks sit `ArrowOffsetPts` `8` points clear.

  • Upper Channel: line, dodger blue, width 2
  • Lower Channel: line, orange red, width 2
  • Buy: arrow, lime, width 2, arrow code 233
  • Sell: arrow, red, width 2, arrow code 234
channel zig zag indicator: Both rails and a break mark on the EURUSD H1 chart.
Both rails and a break mark on the EURUSD H1 chart.

How the Channel Zig Zag Indicator calculates its values

The swing pair

Three settings find them. `ChDepth` `12` sets the swing window, `ChDeviation` `5` the minimum move in points, and `ChBackstep` `3` how close two swings may sit.

Height and placement

The distance between the pair becomes the height. `ChannelWidthK` `1.0` keeps it exactly that, and the lower rail hangs one height under the upper one.

Sticky rails

Here is the part that matters. If a fresh rail lands within `ChDeviation` of the old one, the old value stays. Without that check the corridor would shuffle constantly.

How to read the signals

A close through a rail is the event, not a touch.

Rails that hold steady describe a settled range.

A jump in both rails means a new swing landed.

Channel height is the size of the last swing.

Raising `ChannelWidthK` widens the corridor evenly.

Price spends most of its time between the two.

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

`EnableAlerts` heads the rail-break alerts and arrives true with `EnablePopup`. Set `EnablePushNotify` for a phone, `EnableEmail` for mail, or `EnableSound` to sound `SoundFile`. Breaks report on the closed bar.

Every Channel Zig Zag Indicator input

Core settings

Setting What it does Default
ChDepth ZigZag swing depth (bars). Swing window in bars, `12`. 12
ChDeviation ZigZag deviation (points). Least swing move in points, `5`. 5
ChBackstep ZigZag backstep (bars). Bars kept between swings, `3`. 3

Display settings

Setting What it does Default
ChannelWidthK Channel width multiplier (H-L range). Height as a share of the swing, `1.0`. 1.0
ArrowOffsetPts BUY/SELL arrow offset (points). Points between mark and candle, `8`. 8

Alert settings

Setting What it does Default
EnableAlerts Master switch, `true`. on
EnablePopup Box in the terminal, `true`. on
EnablePushNotify Buzz on a phone, `false`. off
EnableEmail Mail on a rail break, `false`. off
EnableSound (see inputs panel) off
SoundFile Which clip plays, `”alert.wav”`. alert.wav
channel zig zag indicator: Inputs panel with ChDepth, ChDeviation and ChannelWidthK.
Inputs panel with ChDepth, ChDeviation and ChannelWidthK.

Settings that fit your chart

A twelve-bar swing window needs a chart with real structure. EURUSD H1 is the reference chart. A corridor there lasts a day or two. On M5 the swings are noise. On H4 each corridor spans a fortnight.

When the Channel Zig Zag Indicator fails

Swing detection is late by design.

A five-point tolerance is small on a volatile symbol.

The corridor is built from one swing, not from many.

A break can reverse straight back inside the rails.

Copy the compiled Channel Zig Zag 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 Channel Zig Zag Indicator: Donchian channel on Wikipedia, Raff Regression Channel at StockCharts ChartSchool.

Download the Channel Zig Zag Indicator for MT4 and MT5

The zip holds the compiled Channel Zig Zag 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 does ChannelWidthK 1.0 make the height?

Exactly the distance between the last swing high and low. Setting it to 1.5 widens the corridor by half again, which produces fewer break marks and a rail further from ordinary price movement.

Why does ChDeviation 5 keep the rails still?

Because a freshly computed rail within five points of the old one is treated as the same rail. Without that tolerance the corridor would shift a fraction on almost every bar and become unreadable.

How does ChBackstep 3 affect swings?

It stops two swings of the same kind sitting within three bars of each other. That keeps a cluster of similar highs from each claiming to be a separate swing point.

Is a wick through the Upper Channel a signal?

No. The test compares the current close against the rail and the close before it, so price has to finish a bar beyond the corridor. Wicks through the rail print nothing.

Are results guaranteed?

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

Category: this is part of our Volatility collection. Next, plainly, truly, browse more Volatility 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