Join waitlist
Strategies / Trend / EMA and DI Trend Long

EMA and DI Trend Long

The idea buys when price closes above a 9 period EMA while +DI(14) is above 20 and above -DI(14). It sells the long when price closes below the EMA while -DI(14) is above 20 and above +DI(14).

TrendLong onlySwingGold1 hour
n/aProfit factor
1,520Net profit EUR
28.95%Win rate
3,648Trades
-968Max drawdown
0.42Avg trade

Best run of 17. Gold, 1 hour, spread 0.6, from run sweeps:2026-10-04-GOLD-1h-opt.tsv:21.

Entry rules, long

  1. +DI(14) is above 20 and above -DI(14).
  2. No long position is open.

Exit rules

  1. The close is below the 9 period EMA, and -DI(14) is above 20 and above +DI(14), closing the long.

Test conditions

PeriodUp to 2026-10-04
InstrumentGold, 1 hour
Spread0.6 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
GoldBest run1 hourn/a 3,64828.951,520 EUR-968
EUR/USDDailyn/a 45628.9547,951 USD-35,610
Nikkei 2254 hoursn/a 89133.0026,857 USD-8,671
Nikkei 225Dailyn/a 46929.0026,566 USD-14,917
Dow JonesDailyn/a 47036.8117,943 EUR-8,111
Dow Jones4 hoursn/a 35635.1111,432 EUR-8,152
Nasdaq 100Dailyn/a 45834.0611,429 EUR-6,178
Nasdaq 1004 hoursn/a 1,04734.8610,295 EUR-5,941
DAX 404 hoursn/a 1,03333.699,779 EUR-3,377
Brent CrudeDailyn/a 20434.808,304 EUR-7,582
DAX 40Dailyn/a 62732.388,262 EUR-5,593
GBP/USDDailyn/a 48532.788,160 USD-6,692
DAX 401 hourn/a 3,61430.948,105 EUR-5,357
Dow Jones1 hourn/a 1,30232.337,767 EUR-7,268
Gold4 hoursn/a 98934.182,895 EUR-1,279
S&P 500Dailyn/a 52233.722,816 EUR-782
GoldDailyn/a 51829.921,793 EUR-1,512

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// EMA and DI Trend Long
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

ema = ExponentialAverage[9](close)
myDiplus = DIplus[14](close)
myDiminus = DIminus[14](close)

12 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

EMADMI
Read this firstKnown weaknesses3 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 968 EUR is large next to the net profit of 1,520 EUR.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run EMA and DI Trend Long 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 17 market and timeframe combinations. The best run by trade count was Gold, 1 hour, with 3,648 trades.

How large was the drawdown?

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

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

CCI Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

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