Buys when the 9-period EMA crosses above the 21-period EMA and sells short when it crosses below. Each trade has a 1% stop loss and a 2% profit target, and an opposite cross reverses the position.
Best run of 9. USD/JPY, 1 hour, spread 1, from run pf:2026-10-12-USDJPY-1h.tsv:6.
| Period | Up to 2026-10-12 |
| Instrument | USD/JPY, 1 hour |
| 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 | 1 hour | 1.11 | 6,019 | 29.34 | 1,241,380 USD | -252,980 |
| USD/JPY | Daily | n/a | 579 | 33.68 | 640,740 USD | -222,610 |
| USD/JPY | 30 min | n/a | 8,721 | 27.98 | 506,210 USD | -259,550 |
| USD/JPY | 4 hours | n/a | 1,583 | 29.75 | 280,520 USD | -275,850 |
| EUR/USD | Daily | n/a | 551 | 35.93 | 72,798 USD | -28,580 |
| Dow Jones | Daily | n/a | 634 | 31.55 | 9,122 EUR | -3,522 |
| GBP/USD | Daily | n/a | 634 | 33.60 | 8,205 USD | -5,532 |
| Nikkei 225 | Daily | n/a | 479 | 37.16 | 8,152 USD | -6,073 |
| DAX 40 | 1 hour | n/a | 4,857 | 29.61 | 7,422 EUR | -3,854 |
Charts
The code
// ============================================================== // EMA Crossover 1% Stop 2% Target // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 1 hour // ============================================================== DEFPARAM CumulateOrders = false fast = ExponentialAverage[9](close) slow = ExponentialAverage[21](close)
14 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 9 market and timeframe combinations. The best run was USD/JPY, 1 hour, with a profit factor of 1.11 over 6,019 trades.
The best run had a maximum drawdown of 252,980 USD at the tested position size, against a net result of 1,241,380 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.