Join waitlist
Strategies / Trend / EMA Crossover MACD DI Filter

EMA Crossover MACD DI Filter

The idea buys when a 4 period EMA crosses down through a 10 period EMA while the MACD line is below 0 and +DI(28) is above -DI(28). It closes the long when the EMA crosses up with MACD above 0 and +DI(28) below -DI(28).

TrendLong onlySwingNasdaq 1004 hours
2.72Profit factor
17,080Net profit EUR
56.74%Win rate
215Trades
-1,945Max drawdown
79.44Avg trade

Best run of 44. Nasdaq 100, 4 hours, spread 3, from run pf:2026-10-04-NAS100-4h.tsv:8.

Entry rules, long

  1. The MACD line (EMA 5 minus EMA 10) is below 0, and +DI(28) is above -DI(28).
  2. No long position is open.

Exit rules

  1. On the same bar, the MACD line is above 0 and +DI(28) is below -DI(28), closing the long.

Test conditions

PeriodUp to 2026-10-04
InstrumentNasdaq 100, 4 hours
Spread3 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-04

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best run4 hours2.72 21556.7417,080 EUR-1,945
S&P 5004 hours2.13 22257.663,375 EUR-574
Gold1 hour1.51 74944.993,000 EUR-510
Nikkei 22530 min1.30 1,21142.1135,502 USD-6,899
USD/JPY10 minn/a 1,23245.21377,440 USD-176,260
USD/JPY5 minn/a 1,26543.87165,750 USD-102,790
EUR/USDDailyn/a 7740.2687,724 USD-42,240
Nikkei 225Dailyn/a 6360.3247,108 USD-14,175
Nikkei 2252 minn/a 1,21541.3224,560 USD-8,715
Silver15 minn/a 1,22938.0023,443 USD-8,923
Silver30 minn/a 1,21038.5120,876 USD-13,955
Silver2 minn/a 1,20841.4717,459 USD-14,195
Nikkei 2254 hoursn/a 17445.9815,733 USD-7,514
Nikkei 2253 minn/a 1,26740.1715,691 USD-7,653
Nikkei 2251 hourn/a 63542.3612,631 USD-10,648
Dow Jones4 hoursn/a 7147.8912,436 EUR-5,105
DAX 40Dailyn/a 7956.9611,883 EUR-6,249
Dow Jones1 hourn/a 25045.6011,336 EUR-5,283
Nasdaq 1001 hourn/a 76645.959,902 EUR-3,795
Dow Jones10 minn/a 1,22642.589,781 EUR-6,357
Nasdaq 100Dailyn/a 7258.339,196 EUR-3,242
Nasdaq 1003 minn/a 1,17742.999,068 EUR-3,084
Nasdaq 10010 minn/a 1,21942.178,433 EUR-3,025
US Crude Oil4 hoursn/a 14447.227,883 EUR-7,442
DAX 404 hoursn/a 18852.137,675 EUR-4,648
Nasdaq 1002 minn/a 1,17741.896,652 EUR-3,401
Dow Jones5 minn/a 1,24440.686,503 EUR-5,981
Nasdaq 1005 minn/a 1,21742.976,415 EUR-4,597
DAX 4010 minn/a 1,22642.255,375 EUR-2,662
FTSE 100Dailyn/a 7259.724,313 EUR-1,365
FTSE 1004 hoursn/a 19949.753,740 EUR-1,978
DAX 405 minn/a 1,24141.343,688 EUR-3,142
GoldDailyn/a 7548.003,174 EUR-1,108
Nasdaq 1001 minn/a 1,17538.042,839 EUR-2,300
S&P 500Dailyn/a 9253.262,098 EUR-1,247
Gold4 hoursn/a 20943.062,007 EUR-1,095
Gold30 minn/a 1,21341.471,744 EUR-861
Gold10 minn/a 1,22539.841,736 EUR-706
Gold15 minn/a 1,23840.151,533 EUR-786
Gold3 minn/a 1,25239.621,196 EUR-783
S&P 5003 minn/a 1,22441.261,163 EUR-541
S&P 5005 minn/a 1,22840.391,021 EUR-897
S&P 50010 minn/a 1,22043.20842 EUR-740
S&P 5002 minn/a 1,21938.72761 EUR-422

Charts

Results by run

Top 10 of 44 runs. The full list is in the table above.

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// EMA Crossover MACD DI Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

emafast = ExponentialAverage[4](close)
emaslow = ExponentialAverage[10](close)
myMacd = ExponentialAverage[5](close) - ExponentialAverage[10](close)
myDiplus = DIplus[28](close)
myDiminus = DIminus[28](close)

13 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

EMAMACDDMI
Longer historyRe-run on up to 1,000,000 barsNasdaq 100 · 4 hours · older data 0.00 EUR

Nasdaq 100 had no history beyond the standard run, so both runs used 28,000 bars.

Nasdaq 100 · 4 hours

Bars available28,000
Net, standard 200,000-bar run17,079.50 EUR
Net, long run17,079.50 EUR
Net on the older data alone0.00 EUR
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run EMA Crossover MACD DI Filter in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 44 market and timeframe combinations. The best run was Nasdaq 100, 4 hours, with a profit factor of 2.72 over 215 trades.

How large was the drawdown?

The best run had a maximum drawdown of 1,945 EUR at the tested position size, against a net result of 17,080 EUR.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Slow MACD Slope

Uses the same indicator.

6.80 PF · 7,305 trades

Volatility Spike Regression Long

Best run on the same market, Nasdaq 100.

1.22 PF · 1,850 trades

EMA Trend StochRSI Filter

Also a trend strategy.

2.71 PF · 120 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

Copy trading on US indices is available to ProRealAlgos members as spots open.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs