The system goes long when the 20-period EMA crosses above the 50-period EMA and short on the opposite cross. Each trade has a stop 1.5 times ATR(14) from entry and a target twice that distance.
Best run of 7. USD/JPY, Daily, spread 1, from run pf:2026-10-04-USDJPY-D.tsv:5.
| Period | Up to 2026-10-04 |
| 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.74 | 230 | 40.87 | 15,260 USD | -3,240 |
| US Crude Oil | Daily | 1.51 | 212 | 40.09 | 11,607 EUR | -2,561 |
| Nasdaq 100 | Daily | n/a | 200 | 37.00 | 8,146 EUR | -2,616 |
| Brent Crude | Daily | n/a | 98 | 40.82 | 7,939 EUR | -2,198 |
| US Crude Oil | 4 hours | n/a | 431 | 35.96 | 6,920 EUR | -2,813 |
| Nasdaq 100 | 1 hour | n/a | 2,240 | 29.11 | 6,549 EUR | -4,865 |
| Dow Jones | 30 min | n/a | 1,508 | 33.95 | 5,291 EUR | -4,025 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // EMA Crossover With Risk Bracket // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false fast = ExponentialAverage[20](close) slow = ExponentialAverage[50](close) myAtr = AverageTrueRange[14](close) sldist = myAtr * 1.5 tpdist = sldist * 2.0
13 more lines: the entry and exit rules.
Setup
USD/JPY had no history beyond the standard run, so both runs used 12,000 bars.
| Bars available | 12,000 |
| Net, standard 200,000-bar run | 15,260.00 USD |
| Net, long run | 15,260.00 USD |
| Net on the older data alone | 0.00 USD |
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 7 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.74 over 230 trades.
The best run had a maximum drawdown of 3,240 USD at the tested position size, against a net result of 15,260 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.