The strategy buys after a pullback while the 40-period EMA is above the 80-period EMA. It sells when that trend turns down, the close rises above its 20-bar average, the close falls below 0.85 times the entry close, or 20 bars pass.
Best run of 4. S&P 500, Daily, spread 1, from run sweeps:2026-10-04-USA500-D-opt.tsv:16.
| Period | Up to 2026-10-04 |
| Instrument | S&P 500, Daily |
| 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 | Daily | n/a | 3,023 | 46.11 | 1,297 EUR | -1,265 |
| EUR/USD | Daily | n/a | 458 | 70.74 | 65,835 USD | -18,485 |
| Dow Jones | Daily | n/a | 2,816 | 54.30 | 16,484 EUR | -5,786 |
| Nasdaq 100 | Daily | n/a | 2,284 | 47.50 | 8,999 EUR | -3,865 |
Charts
The code
// ============================================================== // Uptrend Pullback With Time Exit // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE held = 0 ONCE myStop = 0 emafast = ExponentialAverage[40](close) emaslow = ExponentialAverage[80](close)
27 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 4 market and timeframe combinations. The best run by trade count was S&P 500, Daily, with 3,023 trades.
The best run had a maximum drawdown of 1,265 EUR at the tested position size, against a net result of 1,297 EUR.
It only takes long trades.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.