Zerolag MACD Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

The usual trick is to de-lag one average. The zerolag macd indicator does it three times: the fast leg, the slow leg and the signal line each get the same correction, which is why its crossings arrive noticeably earlier than a standard build on the same chart.

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 Separate window (levels 0)
Plots 6: ZL Hist Up, ZL Hist Down, ZL MACD, ZL Signal, Cross Up, Cross Down
Alerts popup, push notification, email, sound
Inputs 9

What the Zerolag MACD Indicator draws on the chart

Four pane plots plus two crossing marks.

`ZL Hist Up` fills lime green at width 2.

`ZL Hist Down` fills crimson beside it.

`ZL MACD` traces dodger blue at width 2.

`ZL Signal` traces orange at width 1.

`Cross Up` prints aqua and `Cross Down` magenta.

  • ZL Hist Up: histogram, lime green, width 2
  • ZL Hist Down: histogram, crimson, width 2
  • ZL MACD: line, dodger blue, width 2
  • ZL Signal: line, orange, width 1
  • Cross Up: arrow, aqua, width 2, arrow code 233
  • Cross Down: arrow, magenta, width 2, arrow code 234
zerolag macd indicator: A corrected crossing marked in the pane, EURUSD H1.
A corrected crossing marked in the pane, EURUSD H1.

How the Zerolag MACD Indicator reaches a value

The correction itself

One expression repeated. Twice an average minus an average of that average, which cancels most of the lag the first pass introduced.

Applied to both legs

`FastPeriod` `12` and `SlowPeriod` `26` each take the treatment first, and the code then subtracts one from the other. That difference between two corrected legs becomes the main line.

And to the signal

`SignalPeriod` `9` runs the same correction over the main line. That matters, since an ordinary signal would reintroduce the lag the legs just removed.

How to read the signals

Crossings arrive earlier than a standard build gives.

Earlier is not the same as more reliable.

Marks sit in the pane at the crossing point.

The histogram still measures the gap between the two lines.

Lime green means the main line leads.

Warm-up needs about seventy bars.

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

A crossing of the two corrected lines is what reports. `EnableAlerts` decides whether it speaks and a notice already lands in the terminal, while the phone, mail and desktop routes behind `SoundFile` wait until opened.

Every Zerolag MACD Indicator input

Core settings

Setting What it does Default
FastPeriod Fast zero-lag EMA period. Length of the corrected quick leg, `12`. 12
SlowPeriod Slow zero-lag EMA period. Length of the corrected slow one, `26`. 26
SignalPeriod Signal zero-lag EMA period. Length of the corrected signal, `9`. 9

Alert settings

Setting What it does Default
EnableAlerts Whether a crossing speaks, `true`. on
EnablePopup A notice lands in the terminal, `true`. on
EnablePushNotify It travels on to a phone, `false`. off
EnableEmail It goes out through mail, `false`. off
EnableSound The desktop marks it aloud, `false`. off
SoundFile Sound used for that, `”alert.wav”`. alert.wav
zerolag macd indicator: Inputs panel, the three lengths above the routes.
Inputs panel, the three lengths above the routes.

Choosing where it lives

Removing lag makes a reading busier, so give it a chart with room. EURUSD H1 is the reference chart, where crossings arrive every day or so. On M5 they come far too quickly. On H4 the correction earns its keep.

Where it lets you down

Correcting lag amplifies whatever noise remains.

Three corrections means three chances to overshoot.

Earlier crossings include more false ones.

Seventy bars of warm-up leaves a blank left edge.

Copy the compiled Zerolag MACD 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 Zerolag MACD Indicator for MT4 and MT5

The zip holds the compiled Zerolag MACD 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 correction does FastPeriod 12 receive?

Its average gets doubled, then an average of that average is subtracted. The second pass estimates how far the first fell behind, and removing it pulls the curve back toward price.

Why correct SignalPeriod 9 as well?

Because an ordinary signal line would put the lag straight back. De-lagging both legs and then smoothing the result the usual way would waste most of the work, so the same correction runs over the signal.

Do Cross Up marks appear earlier than a standard MACD?

Yes, usually by a bar or two on the same chart. Whether that helps depends entirely on the market: earlier crossings catch more of a real move and also more of the failed ones.

Is the ZL Hist Up histogram the same measurement as usual?

Yes in construction, no in inputs. It still measures the gap between the main line and its signal, but the correction has touched both, so the columns turn sooner than a standard build’s would.

Are results guaranteed?

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

Category: this is part of our Oscillators collection. Browse more Oscillators 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