The system buys when the EMA(9) crosses above EMA(21) with RSI(14) between 30 and 70 and MACD above its signal line, and sells short on the mirror setup. Each trade uses a stop at 1.0 times ATR(14) and a target at 4.0 times ATR(14).
Best run of 8. S&P 500, 4 hours, spread 1, from run sweeps:2026-10-04-USA500-4h-opt.tsv:77.
| Period | Up to 2026-10-04 |
| Instrument | S&P 500, 4 hours |
| 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| S&P 500Best run | 4 hours | n/a | 1,148 | 22.04 | 1,293 EUR | -1,263 |
| Nikkei 225 | Daily | n/a | 393 | 26.72 | 23,184 USD | -10,382 |
| Dow Jones | 4 hours | n/a | 362 | 26.80 | 9,915 EUR | -5,786 |
| Nasdaq 100 | Daily | n/a | 395 | 20.51 | 9,311 EUR | -3,644 |
| Dow Jones | Daily | n/a | 520 | 21.54 | 6,452 EUR | -5,654 |
| DAX 40 | Daily | n/a | 506 | 23.52 | 5,678 EUR | -2,740 |
| Nasdaq 100 | 4 hours | n/a | 1,140 | 19.74 | 3,486 EUR | -3,299 |
| Gold | Daily | n/a | 496 | 23.79 | 1,243 EUR | -555 |
Charts
The code
// ============================================================== // EMA Crossover With MACD Filter (long and short) // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false emafast = ExponentialAverage[9](close) emaslow = ExponentialAverage[21](close) myRsi = RSI[14](close) myAtr = AverageTrueRange[14](close) myMacd = MACDline[12,26,9](close) macdsig = ExponentialAverage[9](myMacd)
20 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 8 market and timeframe combinations. The best run by trade count was S&P 500, 4 hours, with 1,148 trades.
The best run had a maximum drawdown of 1,263 EUR at the tested position size, against a net result of 1,293 EUR.
It trades both long and short.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.