MTF MACD Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

The four-hour MACD shows the bigger swing while you trade a faster chart. The MTF MACD indicator reads a standard 12, 26, 9 MACD from H4, draws its histogram and signal line under your chart, and marks the bar where the H4 MACD crosses zero. A switch changes that to signal-line crosses.

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

Output you can see

A histogram, a line and two marks.

`HTF MACD` fills dodger blue at width 2.

`HTF Signal` traces orange red at width 2.

`BUY` prints lime on price.

`SELL` prints red on price.

A zero line sits across the pane.

  • HTF MACD: histogram, dodger blue, width 2
  • HTF Signal: line, orange red, width 2
  • BUY: arrow, lime, width 2, arrow code 233
  • SELL: arrow, red, width 2, arrow code 234
mtf macd indicator: H4 MACD pane on an hourly chart, EURUSD H1.
H4 MACD pane on an hourly chart, EURUSD H1.

The logic, one stage at a time

Source

`InpHigherTF` `PERIOD_H4` supplies the MACD. Each chart bar shows the H4 value covering its time.

MACD

`InpFastEMA` `12` and `InpSlowEMA` `26` give the MACD, and `InpSignalSMA` `9` its signal line, on `InpAppliedPrice` `PRICE_CLOSE`.

Signals

`InpSignalOnZeroCross` `true` marks crosses of zero. Set it false to mark crosses of the signal line instead.

Reading the output

Bars above zero mean the H4 trend is up.

Bars below zero mean it is down.

The pane moves in H4 steps.

Marks show H4 zero crosses.

The newest H4 bar still moves.

Warm-up needs H4 history.

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

H4 MACD crosses report once per closed chart bar. `InpEnableAlerts` is the master toggle, and the popup plus the sound playing `InpSoundFile` start on.

Every MTF MACD Indicator input

Core settings

Setting What it does Default
InpHigherTF Higher timeframe for MACD. Timeframe the MACD comes from, `PERIOD_H4`. PERIOD_H4
InpFastEMA Fast EMA period. Fast length, `12`. 12
InpSlowEMA Slow EMA period. Slow length, `26`. 26
InpSignalSMA Signal SMA period. Signal length, `9`. 9
InpAppliedPrice Applied price. Price fed in, `PRICE_CLOSE`. PRICE_CLOSE
InpSignalOnZeroCross Signal on zero-line cross (else MACD/Signal cross). Mark zero crosses, `true`. on

Alert settings

Setting What it does Default
InpEnableAlerts Master alerts toggle. Master alert toggle, `true`. on
InpEnablePopup Popup alert. Popup, `true`. on
InpEnablePush Push notification. Phone route, `false`. off
InpEnableEmail Email alert. off
InpEnableSound Sound alert. Sound, ships on, `true`. on
InpSoundFile Sound file. alert.wav
mtf macd indicator: Inputs panel, source timeframe above the MACD lengths.
Inputs panel, source timeframe above the MACD lengths.

Fitting the settings to a market

An H4 MACD suits M15 and H1 charts. On the hourly EURUSD screenshot, zero crosses come every week or two. On M5 each H4 step spans forty-eight bars. Set the source to D1 when trading H4.

What it misses

Zero crosses of an H4 MACD come late.

The newest H4 bar keeps changing.

Signal-line mode gives many more marks.

The sound route ships on.

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

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

Why does the HTF MACD move in steps?

Every chart bar shows the MACD of the H4 bar covering its time. Four hourly bars share one H4 value, so the histogram forms flat blocks.

What changes with InpSignalOnZeroCross false?

Marks then follow crosses of the MACD and its signal line instead of zero. They come earlier and much more often, including many inside ranges.

Does the HTF MACD work with a daily source?

Yes. Set `InpHigherTF` to D1 and the pane shows the daily MACD, which suits H4 charts. Keep the source above your chart so the reading adds a slower view.

Why can the newest BUY mark change?

The current H4 bar is still forming, so its MACD moves until it closes. A zero cross on that bar can undo itself before the H4 bar ends.

Are results guaranteed?

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