MACD Momentum Indicator: The MACD Line Against Itself

Written by Dominic Walsh · Published · Last updated

The macd momentum indicator measures how fast MACD itself is moving. iMACD supplies the main line. Subtracting its value from `MomentumLag` `5` bars ago leaves a second series in the same pane.

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 4: MACD, Momentum, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 11

What the Macd Momentum Indicator draws on the chart

A dodger blue `MACD` line carries the standard reading.

An orange `Momentum` line carries the difference across the lag.

`Buy` uses arrow 233 and `Sell` uses 234 where that difference crosses zero.

Marks sit `ArrowOffset` `0.0001` away from the candle.

  • MACD: line, dodger blue
  • Momentum: line, orange
  • Buy: arrow, lime, arrow code 233
  • Sell: arrow, red, arrow code 234
Macd momentum indicator blue and orange lines with arrows on the EURUSD H1 chart.
Macd momentum indicator blue and orange lines with arrows on the EURUSD H1 chart.

How the Macd Momentum Indicator calculates its values

The base reading

iMACD runs at `FastEMA` `12`, `SlowEMA` `26` and `SignalEMA` `9`, which are the textbook settings. Only the main line gets read, so the signal line never appears in the pane.

The lag subtraction

The same call runs again `MomentumLag` `5` bars back. Subtracting the older value from the current one gives the orange series. Positive means MACD has risen across those five bars.

Zero is the trigger

A mark appears where the orange series changes sign. That is a statement about the rate of change of MACD, which sits one step further from price than MACD itself.

How to read the signals

Two lines share the pane and mean different things, so read the colour.

The orange series crossing zero means MACD stopped rising or falling.

That crossing usually leads the blue line turning.

`ArrowOffset` `0.0001` is a price distance, not a point count.

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

`EnableAlerts` heads four routes and starts true, and `EnableSound` also ships on with `AlertSoundFile` naming the clip. `EnablePopup` gives the message box. `EnablePushNotify` and `EnableEmail` begin false. Crossings report on closed bars.

Every Macd Momentum Indicator input

Core settings

Setting What it does Default
FastEMA Bars in the fast average inside MACD, default `12`. 12
SlowEMA Bars in the slow average inside MACD, default `26`. 26
SignalEMA Bars in the MACD signal average, default `9`. 9
MomentumLag How far back the subtraction reaches, default `5`. 5

Display settings

Setting What it does Default
ArrowOffset Price distance between mark and candle, default `0.0001`. 0.0001

Alert settings

Setting What it does Default
EnableAlerts Parent switch for the four routes, default `true`. on
EnablePopup Message box inside the terminal, default `true`. on
EnablePushNotify Push through to MetaTrader mobile, default `false`. off
EnableEmail Mail sent by the terminal, default `false`. off
EnableSound Play a clip on an alert, default `true`. on
AlertSoundFile Which clip that is, default `”alert.wav”`. alert.wav
Macd momentum indicator inputs panel with FastEMA, SlowEMA and MomentumLag.
Macd momentum indicator inputs panel with FastEMA, SlowEMA and MomentumLag.

Settings that fit your chart

MACD at 12 and 26 needs a reasonable history. EURUSD H1 is the reference chart, where `SlowEMA` `26` covers over a day. On M5 the orange series crosses zero constantly. H4 charts thin those crossings right out.

When the Macd Momentum Indicator fails

A rate of change on an already smoothed line reacts to very small wiggles.

`ArrowOffset` `0.0001` suits a five-digit currency pair and nothing else.

Two lines on different scales share one pane, which can mislead the eye.

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

The zip holds the compiled Macd Momentum 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 MomentumLag 5 subtract?

The MACD main line as it stood five bars ago, taken away from its current value. A positive result says the line climbed over that span. Shortening the lag makes the orange series jumpier.

Why does the Momentum line lead MACD?

Because a rate of change turns before the thing it measures does. The orange series crosses zero at the moment MACD stops rising, which is usually a bar or two before the blue line itself turns over.

Does SignalEMA 9 get plotted?

No. The code reads only the MACD main buffer, so the classic signal line never reaches the pane. The input still matters, because iMACD needs it to return the main line at all.

What units does ArrowOffset use?

Raw price. A value of `0.0001` is one pip on a five-digit currency pair. On gold or an index that distance is invisible, so change it to suit whatever instrument you load.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Macd Momentum 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