The strategy buys when the close crosses back above its 50-bar average during an uptrend, within 10 bars of a dip below it. It exits when the 50-bar average crosses under the 200-bar average, with a stop set at a recent low.
Best run of 9. DAX 40, Daily, spread 3, from run sweeps:2026-10-12-DAX40-D-opt.tsv:33.
| Period | Up to 2026-10-12 |
| Instrument | DAX 40, Daily |
| Spread | 3 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-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| DAX 40Best run | Daily | n/a | 22 | 59.09 | 9,810 EUR | -3,843 |
| Nikkei 225 | Daily | n/a | 15 | 46.67 | 36,134 USD | -15,140 |
| Nikkei 225 | 4 hours | n/a | 10 | 60.00 | 15,032 USD | -7,424 |
| Nasdaq 100 | Daily | n/a | 21 | 57.14 | 9,475 EUR | -8,787 |
| Brent Crude | 4 hours | n/a | 12 | 75.00 | 6,146 EUR | -3,355 |
| Nasdaq 100 | 4 hours | n/a | 9 | 66.67 | 5,426 EUR | -2,574 |
| Gold | Daily | n/a | 14 | 50.00 | 3,655 EUR | -1,466 |
| FTSE 100 | Daily | n/a | 16 | 43.75 | 2,345 EUR | -1,537 |
| S&P 500 | 4 hours | n/a | 5 | 60.00 | 634 EUR | -308 |
Charts
The code
// ============================================================== // Moving Average Pullback Long // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE lastcu = -100000 ONCE stoppx = 0 smaf = Average[50](close) smas = Average[200](close) myRoc = (close - close[252]) / close[252] * 100 ll = lowest[20](low)
24 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 DAX 40, Daily, with 22 trades.
The best run had a maximum drawdown of 3,843 EUR at the tested position size, against a net result of 9,810 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.