Elliott Wave Indicator: ZigZag Pivot Labelling for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

The elliott wave indicator handles the mechanical half of wave counting. It runs a ZigZag over your chart, keeps the most recent pivots, and numbers them in sequence. A five wave impulse and a three wave correction arrive already labelled. The judgement about whether that count is right stays with you. What the tool removes is the tedium of finding and marking every pivot by hand.

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: ZigZag, Buy, Sell, ZZHidden
Alerts popup
Inputs 7

The visual side

ZigZag draws the dodger blue section line connecting confirmed pivots.

Buy marks a lime arrow at a new swing low, well clear of the candle.

Sell marks the red arrow at a new swing high.

Text objects carry the labels: impulse numbers in yellow, corrective letters in aqua.

ZZHidden is a working buffer with DRAW_NONE and never reaches the screen.

  • ZigZag: section, dodger blue, width 2
  • Buy: arrow, lime, width 2, arrow code 233
  • Sell: arrow, red, width 2, arrow code 234
  • ZZHidden: hidden buffer
Elliott wave indicator on EURUSD H1 with the ZigZag skeleton and numbered pivots
Elliott wave indicator on EURUSD H1 with the ZigZag skeleton and numbered pivots

What feeds each plot

Building the swing skeleton

The ZigZag scan treats `InpDepth` as the minimum separation between pivots. `InpDevPct` adds an optional size filter, expressed as a percentage of price. At its `0.0` default only depth applies. The scan begins a warmup of MathMax(InpDepth * 4, 50) bars back, so the first pivots carry enough history behind them to hold up.

Numbering the sequence

The code keeps pivots in order and gives each one a position through seq = idx – start + 1. The first five take impulse numbers and the next three take corrective letters, up to the `InpMaxPivots` ceiling of `9`. That covers one full cycle plus its starting point. Labels sit `InpLabelOffset` points away from the pivot, clear of the candle.

Flagging the newest pivot

When a fresh pivot confirms, the code writes an arrow on that bar. BuyBuf takes low[bar] minus 1.5 times the offset. SellBuf takes high[bar] plus the same. That multiplier holds the arrow further out than the text label, so the two never overlap on a tight chart.

Reading the plots

The numbers are a proposal from the ZigZag, not a verified wave count. Check them against the rules you use.

A count that renumbers after a new pivot means the skeleton changed, which is normal ZigZag behaviour.

The arrow tells you a pivot just confirmed. The label tells you where the code places it in the cycle.

Once nine pivots fill the screen, the oldest drops as new ones confirm.

Alert channels in this build: popup, one message per closed bar.

A terminal popup is the only channel, driven by `InpEnableAlerts` at its `true` default. The message announces a newly confirmed pivot after the bar closes, and the guard allows a single alert per bar even when the skeleton redraws.

Every Elliott Wave Indicator input

Core settings

Setting What it does Default
InpDepth ZigZag swing depth (bars). Minimum bars between pivots, default `5`. This is the main dial for how much detail the count keeps. 5
InpDevPct Min swing dev (% of price; 0 = off). Minimum swing size as a percentage of price, default `0.0`, meaning off. Set a small value to skip shallow legs. 0.0
InpMaxPivots Max pivots to label (5 impulse + 3 corrective + 1). How many pivots keep their labels, default `9`. Lower it to show only the current leg. 9

Display settings

Setting What it does Default
InpLabelOffset Vertical label offset (points). Gap in points between a pivot and its text, default `25`. 25
InpImpulseColor 1-5 label color. yellow
InpCorrColor A-B-C label color. aqua

Alert settings

Setting What it does Default
InpEnableAlerts Alert on new pivot. on
Elliott wave indicator inputs showing InpDepth, InpMaxPivots and InpLabelOffset
Elliott wave indicator inputs showing InpDepth, InpMaxPivots and InpLabelOffset

Where to run it

Wave counting needs swings large enough to read without ambiguity, which favours H1 and above. EURUSD H1 is the reference chart. A depth of `5` there updates the count a few times a day. On M5 that same depth labels almost every wiggle, and the nine pivot ceiling recycles so fast the labels become hard to follow. Raise `InpDepth` before you drop the timeframe.

Where it comes unstuck

ZigZag pivots stay provisional until the next pivot confirms, so the newest label can change. Every ZigZag based count carries that cost.

The numbering works positionally. It counts pivots in order and never tests the Elliott rules, so it will happily label a sequence that breaks them.

A sideways market alternates pivots without a real impulse, and the 1 to 5 labels then mean nothing.

Copy the compiled Elliott Wave 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 Elliott Wave Indicator: Elliott Wave Analysis Articles at StockCharts ChartSchool, The Elliott Wave Theorist on Wikipedia.

Download the Elliott Wave Indicator for MT4 and MT5

The zip holds the compiled Elliott Wave 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

Does InpMaxPivots checking include the Elliott rules?

No. The code numbers pivots in the order the ZigZag finds them: the first five take 1 to 5, the next three take A, B and C, up to the `InpMaxPivots` ceiling. It never tests whether wave 3 is the shortest, or whether wave 4 overlaps wave 1. Treat the labels as a starting point you then validate.

Why did my ZigZag wave numbers change on the last bar?

A ZigZag pivot is not final until the following pivot confirms it. When price extends past the level the scan treated as a turn, the code discards that pivot and renumbers from there. Older labels well behind current price rarely move. The newest one or two are the unstable ones.

What is InpMaxPivots limiting?

The number of pivots that keep their labels on screen, default `9`. That covers a five wave impulse, a three wave correction, and the pivot they started from, which is one full cycle. Reducing it declutters the chart when only the leg in progress matters to you.

Should I use InpDevPct instead of InpDepth?

They filter different things. `InpDepth` counts bars, so it skips small wiggles that resolve quickly. `InpDevPct` filters by size as a percentage of price, so it skips shallow legs however long they take. It ships at `0.0`, which switches it off. Add a small value when the chart shows many tiny legs that clear the depth test.

Are results guaranteed?

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

Category: this is part of our Signal and Forecast collection. Also, browse more Signal and Forecast 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