Buys when the 9-period EMA crosses above the 20-period EMA while the close is above the 200-period EMA. Sells when the close crosses below the 20-period EMA, with no stop or target.
Best run of 19. USD/JPY, 1 hour, spread 1, from run pf:2026-10-10-USDJPY-1h.tsv:2.
| Period | Up to 2026-10-10 |
| 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-10 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | 1 hour | 1.22 | 1,686 | 30.31 | 477,920 USD | -97,140 |
| USD/JPY | Daily | n/a | 147 | 27.89 | 348,120 USD | -298,260 |
| USD/JPY | 4 hours | n/a | 431 | 36.19 | 317,670 USD | -113,950 |
| USD/JPY | 30 min | n/a | 2,459 | 28.02 | 235,390 USD | -115,880 |
| EUR/USD | Daily | n/a | 134 | 32.84 | 35,592 USD | -23,915 |
| Nikkei 225 | Daily | n/a | 162 | 32.10 | 19,572 USD | -7,823 |
| Dow Jones | Daily | n/a | 245 | 42.86 | 13,822 EUR | -3,783 |
| Nikkei 225 | 1 hour | n/a | 1,323 | 29.48 | 11,207 USD | -7,279 |
| DAX 40 | Daily | n/a | 229 | 38.86 | 10,118 EUR | -3,054 |
| Silver | 4 hours | n/a | 379 | 28.76 | 9,506 USD | -5,999 |
| Dow Jones | 4 hours | n/a | 160 | 34.38 | 9,077 EUR | -3,415 |
| Nasdaq 100 | Daily | n/a | 206 | 33.01 | 5,659 EUR | -3,300 |
| DAX 40 | 4 hours | n/a | 492 | 33.54 | 4,704 EUR | -2,718 |
| Brent Crude | 30 min | n/a | 1,648 | 30.46 | 2,927 EUR | -2,558 |
| FTSE 100 | Daily | n/a | 194 | 40.21 | 1,988 EUR | -1,266 |
| Gold | Daily | n/a | 202 | 30.20 | 1,401 EUR | -614 |
| S&P 500 | Daily | n/a | 262 | 38.17 | 1,300 EUR | -586 |
| Gold | 4 hours | n/a | 386 | 36.53 | 1,046 EUR | -472 |
| Gold | 5 min | n/a | 2,747 | 25.99 | 514 EUR | -510 |
Charts
Top 10 of 19 runs. The full list is in the table above.
The code
// ============================================================== // EMA 9 20 Trend Filtered Long // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: 1 hour // ============================================================== DEFPARAM CumulateOrders = false emashort = ExponentialAverage[9](close) emalong = ExponentialAverage[20](close) ematrend = ExponentialAverage[200](close)
10 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 19 market and timeframe combinations. The best run was USD/JPY, 1 hour, with a profit factor of 1.22 over 1,686 trades.
The best run had a maximum drawdown of 97,140 USD at the tested position size, against a net result of 477,920 USD.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.