The ema cross indicator is the plainest tool in the library and makes no apology for it. Two exponential averages run over price at `FastPeriod` and `SlowPeriod` bars. When the fast one crosses the slow one, an arrow lands on that bar. Nothing else is bolted on.
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: Fast EMA, Slow EMA, Buy Signal, Sell Signal |
| Alerts | popup, push notification, email, sound |
| Inputs | 9 |
What the EMA Cross Indicator draws on the chart
Fast EMA is the dodger blue line at `FastPeriod` `10` bars.
Slow EMA is the orange line at `SlowPeriod` `30` bars.
Buy Signal drops a lime arrow below a bar where blue crossed above orange.
Sell Signal puts a red arrow above the bar for the opposite crossing.
- Fast EMA: line, dodger blue, width 2
- Slow EMA: line, orange, width 2
- Buy Signal: arrow, lime, width 2, arrow code 233
- Sell Signal: arrow, red, width 2, arrow code 234

How the EMA Cross Indicator calculates its values
Reading both averages from the terminal
iMA supplies EMA(close, n) for both periods, so the lines match any other exponential average you plot. Exponential weighting gives the newest close the most say and never quite discards the oldest. That is why the blue line turns before a simple average would.
Detecting the crossing
The code reads both averages at the current bar and at the one before it. A buy needs fast below or level with slow previously, and fast above slow now. Reading both bars is what turns a state into an event.
Offsetting in pips, not points
offset takes `ArrowOffsetPips` `5` times Point times ten. That multiplication converts points into pips on a five-digit feed. So the arrow keeps a five pip gap from the candle rather than a five point one.
How to read the signals
A crossing tells you the short average has overtaken the long one.
The gap between the two lines is a rough gauge of how quickly that happened.
In a range the pair cross back and forth with no follow-through.
Widen the distance between `FastPeriod` and `SlowPeriod` for fewer crossings.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
`EnableAlerts` ships on and `EnablePopup` carries the message. `EnablePushNotify`, `EnableEmail` and `EnableSound` stay off by default. `SoundFile` names the clip. The crossing test reads bar 1 and bar 2, so one message follows each closed bar.
Every EMA Cross Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
FastPeriod |
Short average length, default `10`. | 10 |
SlowPeriod |
Long average length, default `30`. | 30 |
Display settings
| Setting | What it does | Default |
|---|---|---|
ArrowOffsetPips |
Arrow gap from the candle in pips, default `5`. | 5 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Switches the crossing alerts on as a group, default `true`. | on |
EnablePopup |
Raises the terminal dialog on a crossing, default `true`. | on |
EnablePushNotify |
Sends the crossing to the MetaTrader mobile app, default `false`. | off |
EnableEmail |
Mails the crossing through the terminal, default `false`. | off |
EnableSound |
Plays a file when a crossing prints, default `false`. | off |
SoundFile |
Name of the wav file the crossing alert uses, default `alert.wav`. | alert.wav |

Settings that fit your chart
A crossing pair works anywhere, which is both its appeal and its weakness. EURUSD H1 is the reference chart, where `SlowPeriod` at `30` covers over a day. On M5 the two lines tangle and cross constantly. On H4 and daily a crossing is rare enough to be worth a look on its own.
When the EMA Cross Indicator fails
Two averages of the same series cross late. That is arithmetic, not a fault in the settings.
Sideways price produces crossings in both directions within a handful of bars.
There is no filter of any kind here, so a crossing against the larger trend looks the same as one with it.
Copy the compiled EMA Cross 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 EMA Cross Indicator: Cross listing on Wikipedia, Economic Indicators at StockCharts ChartSchool.
Download the EMA Cross Indicator for MT4 and MT5
The zip holds the compiled EMA Cross 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.
FAQ
What do FastPeriod and SlowPeriod default to?
Ten and thirty bars. That ratio of one to three is a common starting point and keeps the two lines far enough apart to separate visibly. Narrow the gap and crossings multiply. Widen it and each crossing carries more weight but arrives later.
Why does ArrowOffsetPips multiply by ten?
Because Point on a five-digit feed is a tenth of a pip. The code takes `ArrowOffsetPips` `5`, multiplies by Point and then by ten, which lands on five actual pips. Without that step the arrow would sit half a pip from the candle.
Does the Buy Signal plot check the previous bar?
Yes, and that is the whole test. It needs the fast average at or below the slow one on the earlier bar and above it now. Checking only the current bar would mark every bar of a trend rather than the crossing itself.
Is EMA better than SMA for this on H1?
It reacts sooner, which cuts both ways. On EURUSD H1 an exponential pair crosses a bar or two before a simple pair would, so entries come earlier and false crossings come more often too. Neither choice removes the lag that a crossing carries by design.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the EMA Cross Indicator as one input. Always backtest before trading live.
Category: this is part of our Trend collection. Also, truly, browse more Trend for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- For background on this concept, see Cross listing on Wikipedia.
- For broader market context, see Economic Indicators at StockCharts ChartSchool.
