The system buys when the 7-period EMA crosses above the 21-period EMA while the 50-period EMA is above the 200-period EMA. It sells short on the mirror conditions and exits on an opposite cross or a close through the 50-period EMA.
Best run of 13. Nikkei 225, Daily, spread 10, from run pf:2026-10-05-NIKKEI-D.tsv:11.
| Period | Up to 2026-10-05 |
| Instrument | Nikkei 225, Daily |
| Spread | 10 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 |
|---|---|---|---|---|---|---|
| Nikkei 225Best run | Daily | 1.81 | 244 | 30.33 | 48,834 USD | -8,018 |
| EUR/USD | Daily | 1.50 | 274 | 34.31 | 98,877 USD | -20,455 |
| USD/JPY | Daily | n/a | 303 | 31.02 | 1,288,520 USD | -582,450 |
| USD/JPY | 1 hour | n/a | 2,980 | 25.57 | 520,090 USD | -159,550 |
| EUR/USD | 4 hours | n/a | 1,000 | 28.60 | 43,953 USD | -32,145 |
| Dow Jones | Daily | n/a | 322 | 31.37 | 13,023 EUR | -4,984 |
| Nasdaq 100 | Daily | n/a | 259 | 30.12 | 11,468 EUR | -5,165 |
| DAX 40 | Daily | n/a | 323 | 34.98 | 9,338 EUR | -3,157 |
| US Crude Oil | 1 hour | n/a | 1,924 | 28.38 | 5,667 EUR | -4,705 |
| Gold | Daily | n/a | 316 | 31.01 | 3,198 EUR | -809 |
| Gold | 4 hours | n/a | 661 | 27.23 | 2,287 EUR | -726 |
| Gold | 1 hour | n/a | 2,639 | 25.12 | 1,731 EUR | -708 |
| S&P 500 | Daily | n/a | 364 | 27.20 | 1,235 EUR | -768 |
Charts
Top 10 of 13 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // EMA Crossover Trend Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false emaa = ExponentialAverage[7](close) emab = ExponentialAverage[21](close) emac = ExponentialAverage[50](close) emad = ExponentialAverage[200](close)
24 more lines: the entry and exit rules.
Setup
Nikkei 225 had no history beyond the standard run, so both runs used 11,000 bars.
| Bars available | 11,000 |
| Net, standard 200,000-bar run | 48,833.50 USD |
| Net, long run | 48,833.50 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 13 market and timeframe combinations. The best run was Nikkei 225, Daily, with a profit factor of 1.81 over 244 trades.
The best run had a maximum drawdown of 8,018 USD at the tested position size, against a net result of 48,834 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.