The strategy buys when the 12-period EMA crosses above the 26-period EMA and sells short when it crosses below. Each trade has a stop set at 2 times the 14-period ATR and a target 1.5 times that stop distance.
Best run of 9. S&P 500, 4 hours, spread 1, from run sweeps:2026-10-11-USA500-4h-opt.tsv:91.
| Period | Up to 2026-10-11 |
| 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-11 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| S&P 500Best run | 4 hours | n/a | 1,094 | 38.03 | 2,880 EUR | -1,161 |
| Dow Jones | Daily | n/a | 510 | 34.51 | 20,875 EUR | -8,519 |
| Silver | Daily | n/a | 443 | 38.83 | 17,525 USD | -16,577 |
| Dow Jones | 4 hours | n/a | 363 | 41.32 | 16,779 EUR | -4,712 |
| US Crude Oil | 4 hours | n/a | 804 | 38.68 | 11,235 EUR | -3,492 |
| US Crude Oil | Daily | n/a | 390 | 39.49 | 8,792 EUR | -3,942 |
| DAX 40 | Daily | n/a | 480 | 38.33 | 5,546 EUR | -3,965 |
| Gold | 4 hours | n/a | 1,018 | 38.41 | 1,723 EUR | -681 |
| Gold | Daily | n/a | 481 | 34.72 | 863 EUR | -733 |
Charts
The code
// ============================================================== // EMA Crossover With ATR Bracket (long and short) // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false fast = ExponentialAverage[12](close) slow = ExponentialAverage[26](close) myAtr = Average[14](TR(close))
16 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 9 market and timeframe combinations. The best run by trade count was S&P 500, 4 hours, with 1,094 trades.
The best run had a maximum drawdown of 1,161 EUR at the tested position size, against a net result of 2,880 EUR.
It trades both long and short.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.