The strategy buys when the 20-period EMA crosses above the 50-period EMA and sells short when it crosses below, provided no trade is open. Each trade has a stop at 2 times the 14-period ATR and a target at 1.5 times the stop distance.
Best run of 6. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:45.
| Period | Up to 2026-10-12 |
| Instrument | USD/JPY, Daily |
| 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-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.47 | 230 | 43.91 | 12,150 USD | -3,030 |
| Dow Jones | 30 min | n/a | 1,196 | 42.14 | 11,148 EUR | -3,623 |
| US Crude Oil | Daily | n/a | 196 | 46.43 | 11,128 EUR | -4,366 |
| Brent Crude | Daily | n/a | 87 | 51.72 | 9,092 EUR | -2,441 |
| US Crude Oil | 4 hours | n/a | 401 | 42.14 | 4,805 EUR | -2,506 |
| Nasdaq 100 | Daily | n/a | 179 | 37.99 | 3,978 EUR | -2,732 |
Charts
The code
// ============================================================== // EMA Crossover With ATR Risk Limits // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false emafast = ExponentialAverage[20](close) emaslow = ExponentialAverage[50](close) myAtr = Average[14](TR(close)) dist = 2.0 * myAtr
13 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 6 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.47 over 230 trades.
The best run had a maximum drawdown of 3,030 USD at the tested position size, against a net result of 12,150 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.