The strategy buys when price dips below its 20-bar average minus the 20-bar ATR and MACD is rising toward its signal line. It exits when the close falls to a trailing level 2 times the 26-bar ATR below the highest close since entry.
Best run of 14. S&P 500, 30 min, spread 1, from run sweeps:2026-10-10-USA500-30m-opt.tsv:4.
| Period | Up to 2026-10-10 |
| Instrument | S&P 500, 30 minutes |
| 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 | 30 min | n/a | 5,343 | 36.66 | 1,918 EUR | -1,889 |
| Nikkei 225 | 4 hours | n/a | 771 | 39.69 | 27,777 USD | -12,135 |
| Dow Jones | Daily | n/a | 422 | 41.23 | 24,863 EUR | -9,887 |
| Dow Jones | 30 min | n/a | 2,178 | 37.65 | 17,539 EUR | -9,620 |
| Nasdaq 100 | 4 hours | n/a | 900 | 39.44 | 17,536 EUR | -4,782 |
| Nasdaq 100 | 1 hour | n/a | 3,361 | 36.63 | 16,584 EUR | -5,019 |
| DAX 40 | Daily | n/a | 462 | 40.91 | 13,511 EUR | -5,854 |
| Nasdaq 100 | Daily | n/a | 345 | 37.97 | 12,896 EUR | -5,697 |
| DAX 40 | 4 hours | n/a | 916 | 40.28 | 12,863 EUR | -5,515 |
| Nasdaq 100 | 30 min | n/a | 5,257 | 36.50 | 7,678 EUR | -6,474 |
| S&P 500 | Daily | n/a | 456 | 39.25 | 3,806 EUR | -1,657 |
| Gold | Daily | n/a | 426 | 39.44 | 2,566 EUR | -1,692 |
| S&P 500 | 4 hours | n/a | 919 | 41.35 | 2,107 EUR | -1,250 |
| Gold | 4 hours | n/a | 906 | 40.73 | 2,020 EUR | -1,264 |
Charts
Top 10 of 14 runs. The full list is in the table above.
The code
// ============================================================== // Band Dip Anticipated MACD Cross // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long only // Timeframe tested: 30 minutes // ============================================================== DEFPARAM CumulateOrders = false ONCE slbuf = 0 ONCE slp = 0 ONCE touched = 0 center = Average[20](close) myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close) sig = ExponentialAverage[9](myMacd) buffer = AverageTrueRange[26](close) * 2 slp = MAX(slp, close - slbuf) IF NOT LongOnMarket THEN slp = close - slbuf ENDIF
25 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 14 market and timeframe combinations. The best run by trade count was S&P 500, 30 minutes, with 5,343 trades.
The best run had a maximum drawdown of 1,889 EUR at the tested position size, against a net result of 1,918 EUR.
It only takes long trades.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.