The strategy buys when the 10-period EMA crosses above the 21-period EMA in a bullish EMA stack with ADX above 25. It sells short on the mirror cross in a bearish stack, and exits when the EMAs cross back.
Best run of 13. USD/JPY, 30 min, spread 1, from run sweeps:2026-10-04-USDJPY-30m-opt.tsv:77.
| Period | Up to 2026-10-04 |
| Instrument | USD/JPY, 30 minutes |
| Spread | 1 points |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-10-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | 30 min | n/a | 260 | 32.31 | 121,840 USD | -52,470 |
| USD/JPY | Daily | n/a | 23 | 43.48 | 664,040 USD | -205,950 |
| USD/JPY | 1 hour | n/a | 157 | 30.57 | 102,410 USD | -79,840 |
| USD/JPY | 15 min | n/a | 210 | 29.52 | 80,570 USD | -65,520 |
| EUR/USD | Daily | n/a | 11 | 54.55 | 15,071 USD | -5,924 |
| Silver | 2 min | n/a | 187 | 25.67 | 3,778 USD | -3,608 |
| Nikkei 225 | 5 min | n/a | 192 | 30.73 | 3,352 USD | -3,079 |
| US Crude Oil | 4 hours | n/a | 35 | 37.14 | 3,253 EUR | -1,187 |
| Brent Crude | 4 hours | n/a | 15 | 33.33 | 2,753 EUR | -1,388 |
| Gold | 1 hour | n/a | 165 | 31.52 | 549 EUR | -379 |
| Gold | 5 min | n/a | 149 | 26.17 | 277 EUR | -141 |
| Gold | Daily | n/a | 12 | 33.33 | 265 EUR | -165 |
| Gold | 4 hours | n/a | 46 | 30.43 | 216 EUR | -176 |
Charts
Top 10 of 13 runs. The full list is in the table above.
The code
// ============================================================== // EMA Stack ADX Crossover // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================== DEFPARAM CumulateOrders = false emaa = ExponentialAverage[10](close) emab = ExponentialAverage[21](close) emac = ExponentialAverage[55](close) emad = ExponentialAverage[200](close) myAdx = ADX[14]
20 more lines: the entry and exit rules.
Setup
Questions
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.
It was tested on 13 market and timeframe combinations. The best run by trade count was USD/JPY, 30 minutes, with 260 trades.
The best run had a maximum drawdown of 52,470 USD at the tested position size, against a net result of 121,840 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.