Buys when the 21 period EMA crosses up through the 55 period EMA. Closes the long when the 21 period EMA falls back below the 55 period EMA.
Best run of 36. Gold, 3 min, spread 0.6, from run sweeps:2026-10-04-GOLD-3m-opt.tsv:8.
| Period | Up to 2026-10-04 |
| Instrument | Gold, 3 minutes |
| Spread | 0.6 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 |
|---|---|---|---|---|---|---|
| GoldBest run | 3 min | n/a | 1,861 | 27.89 | 1,054 EUR | -639 |
| USD/JPY | Daily | n/a | 101 | 35.64 | 1,399,740 USD | -477,480 |
| USD/JPY | 30 min | n/a | 1,696 | 31.60 | 734,330 USD | -209,550 |
| USD/JPY | 10 min | n/a | 1,767 | 31.07 | 389,690 USD | -120,610 |
| USD/JPY | 15 min | n/a | 1,770 | 30.23 | 380,820 USD | -161,870 |
| Nikkei 225 | Daily | n/a | 91 | 35.16 | 44,899 USD | -15,247 |
| Nikkei 225 | 4 hours | n/a | 231 | 35.50 | 32,750 USD | -8,331 |
| Nikkei 225 | 1 hour | n/a | 892 | 31.61 | 25,632 USD | -12,534 |
| Dow Jones | Daily | n/a | 128 | 37.50 | 24,022 EUR | -8,131 |
| Nasdaq 100 | Daily | n/a | 95 | 48.42 | 19,642 EUR | -3,201 |
| Nikkei 225 | 2 min | n/a | 1,736 | 30.41 | 19,163 USD | -7,526 |
| Nikkei 225 | 3 min | n/a | 1,767 | 29.82 | 13,258 USD | -7,982 |
| Nasdaq 100 | 30 min | n/a | 1,699 | 32.90 | 12,729 EUR | -4,093 |
| US Crude Oil | Daily | n/a | 98 | 37.76 | 12,036 EUR | -5,799 |
| DAX 40 | 4 hours | n/a | 281 | 33.45 | 10,863 EUR | -3,365 |
| Nasdaq 100 | 1 hour | n/a | 1,038 | 33.82 | 10,327 EUR | -4,632 |
| DAX 40 | Daily | n/a | 138 | 36.23 | 10,178 EUR | -5,478 |
| Dow Jones | 1 hour | n/a | 354 | 34.18 | 9,721 EUR | -5,792 |
| Nasdaq 100 | 4 hours | n/a | 281 | 38.79 | 9,549 EUR | -6,079 |
| Dow Jones | 4 hours | n/a | 96 | 39.58 | 9,225 EUR | -6,974 |
| Nasdaq 100 | 5 min | n/a | 1,725 | 29.57 | 8,281 EUR | -4,051 |
| Nasdaq 100 | 15 min | n/a | 1,739 | 31.57 | 8,213 EUR | -3,529 |
| DAX 40 | 30 min | n/a | 1,739 | 31.28 | 7,966 EUR | -4,767 |
| DAX 40 | 15 min | n/a | 1,739 | 29.67 | 6,672 EUR | -3,600 |
| Brent Crude | Daily | n/a | 45 | 37.78 | 6,014 EUR | -5,482 |
| S&P 500 | Daily | n/a | 127 | 40.16 | 4,620 EUR | -1,162 |
| DAX 40 | 10 min | n/a | 1,782 | 29.18 | 3,850 EUR | -3,440 |
| S&P 500 | 4 hours | n/a | 277 | 37.55 | 2,867 EUR | -886 |
| Gold | 30 min | n/a | 1,709 | 30.13 | 2,865 EUR | -994 |
| Gold | Daily | n/a | 126 | 34.13 | 2,840 EUR | -1,306 |
| Gold | 1 hour | n/a | 1,025 | 32.98 | 2,758 EUR | -1,235 |
| Gold | 4 hours | n/a | 286 | 31.12 | 1,910 EUR | -1,615 |
| Gold | 15 min | n/a | 1,789 | 28.17 | 1,855 EUR | -798 |
| S&P 500 | 1 hour | n/a | 1,077 | 35.75 | 1,679 EUR | -1,200 |
| Gold | 10 min | n/a | 1,812 | 27.37 | 1,500 EUR | -899 |
| Gold | 5 min | n/a | 1,826 | 29.57 | 1,399 EUR | -940 |
Charts
Top 10 of 36 runs. The full list is in the table above.
The code
// ============================================================== // EMA 21 55 Crossover // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: 3 minutes // ============================================================== DEFPARAM CumulateOrders = false ONCE trend = -1 emaslow = ExponentialAverage[55](close) emafast = ExponentialAverage[21](close) prev = trend
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 36 market and timeframe combinations. The best run by trade count was Gold, 3 minutes, with 1,861 trades.
The best run had a maximum drawdown of 639 EUR at the tested position size, against a net result of 1,054 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.