The strategy buys when the 9-period EMA crosses above the 21-period EMA and sells short on the reverse cross. Each entry uses a stop at the signal candle's low or high, and positions close when the 21-period EMA turns against them.
Best run of 2. USD/JPY, Daily, spread 1, from run pf:2026-10-05-USDJPY-D.tsv:12.
| Period | Up to 2026-10-05 |
| 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-05 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 4.52 | 579 | 1.38 | 264,550 USD | -62,650 |
| Nikkei 225 | Daily | n/a | 480 | 20.21 | 16,444 USD | -12,618 |
Charts
The code
// ============================================================== // EMA Cross Reversal With Candle Stop // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false emafast = ExponentialAverage[9](close) emaslow = ExponentialAverage[21](close)
24 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 | 264,550.00 USD |
| Net, long run | 264,550.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 2 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 4.52 over 579 trades.
The best run had a maximum drawdown of 62,650 USD at the tested position size, against a net result of 264,550 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.