MACD Alert Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

This is the textbook reading with a messenger attached. The macd alert indicator draws the main line, its signal and the histogram between them, all at the published periods. What it adds is four ways to hear about a crossing without watching the 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 3: MACD, Signal, Histogram
Alerts popup, push notification, email, sound
Inputs 10

What the Macd Alert Indicator draws on the chart

Two lines and a histogram in the pane.

`MACD` runs royal blue at width 2.

`Signal` runs tomato beside it.

`Histogram` fills lawn green at width 1.

A level sits at zero.

Nothing appears on the price chart.

  • MACD: line, royal blue, width 2
  • Signal: line, tomato, width 2
  • Histogram: histogram, lawn green, width 1
macd alert indicator: Both lines and the histogram on the EURUSD H1 chart.
Both lines and the histogram on the EURUSD H1 chart.

How the Macd Alert Indicator calculates its values

One terminal call

iMACD supplies both lines. `FastPeriod` `12`, `SlowPeriod` `26` and `SignalPeriod` `9` set them, reading `AppliedPrice` `PRICE_CLOSE`. Gerald Appel published those numbers.

The bars between

Subtraction gives the histogram. Signal taken from main line, bar by bar. So a tall column means the two have parted and a short one means they are close.

Watching for a cross

Only two bars matter. The code compares the last closed bar with the one before it. A change of side between them is the crossing that raises a message.

How to read the signals

A crossing is the main line passing its signal.

The histogram reaching zero is the same event.

Shrinking columns lead a crossing.

Above zero the shorter average inside leads.

Both lines drawn means you can see the cross coming.

Alerts fire on closed bars only.

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

`EnableAlerts` sits over the crossing alerts and starts true with `EnablePopup`. `EnablePushNotify` reaches a phone, `EnableEmail` posts mail and `EnableSound` sounds `SoundFile`. Those three arrive off, and one message goes out per closed bar.

Every Macd Alert Indicator input

Core settings

Setting What it does Default
FastPeriod Shorter average inside, `12`. 12
SlowPeriod Longer average inside, `26`. 26
SignalPeriod Average drawn off the main line, `9`. 9
AppliedPrice Price the calculation reads, `PRICE_CLOSE`. PRICE_CLOSE

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 crossing, `false`. off
EnableSound Cue on a crossing, `false`. off
SoundFile Which clip plays, `”alert.wav”`. alert.wav
macd alert indicator: Inputs panel with FastPeriod, SlowPeriod and SignalPeriod.
Inputs panel with FastPeriod, SlowPeriod and SignalPeriod.

Settings that fit your chart

The published periods came from daily bars, which is worth remembering. EURUSD H1 is the reference chart. Crossings arrive every day or two there. On M5 they come constantly. On daily bars each one covers weeks.

When the Macd Alert Indicator fails

Three averages stacked together lag badly.

In a range the lines cross with nothing behind it.

A crossing far from zero is different from one at zero.

The alert says a cross happened, never how far it runs.

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

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

Which bars does the MACD alert check read?

The last two closed ones. It reads the main line and its signal on each, and a change of side between them counts as a crossing. The bar still forming gets ignored entirely.

What does AppliedPrice PRICE_CLOSE change?

Which price feeds both averages inside. Switching it to typical or median price makes the reading account for the whole bar, which turns the lines slightly earlier at the cost of matching the standard everyone else sees.

Why plot the Histogram as well as both lines?

Because it shows convergence at a glance. Column height is the exact gap between the two lines, so shrinking columns warn of a crossing well before the lines actually meet.

Are FastPeriod and SlowPeriod the standard values?

Yes. Twelve, twenty-six and nine are the figures Gerald Appel published, and nothing here changes them. The alert routes are what this build adds over the terminal indicator.

Are results guaranteed?

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

Category: this is part of our Oscillators collection. Also, truly, 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