The strategy buys when close crosses above the 20-bar SMA while above the 89-bar and 200-bar EMAs, after recent closes reached the lower bands. It sells short on the mirror setup.
Best run of 3. US Crude Oil, 1 hour, spread 3, from run sweeps:2026-10-07-CRUDE-1h-opt.tsv:4.
| Period | Up to 2026-10-07 |
| Instrument | US Crude Oil, 1 hour |
| 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-07 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| US Crude OilBest run | 1 hour | n/a | 591 | 69.20 | 1,816 EUR | -1,285 |
| Nasdaq 100 | Daily | n/a | 44 | 61.36 | 2,218 EUR | -1,056 |
| DAX 40 | 4 hours | n/a | 138 | 63.77 | 1,834 EUR | -847 |
Charts
The code
// ============================================================== // Basis Cross Reversion With Trend Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long & short // Timeframe tested: 1 hour // ============================================================== DEFPARAM CumulateOrders = false emaa = ExponentialAverage[89](close) emab = ExponentialAverage[200](close) basis = Average[20](close) dev = STD[20](close) upone = basis + dev loone = basis - dev uptwo = basis + 2 * dev lotwo = basis - 2 * dev
30 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 3 market and timeframe combinations. The best run by trade count was US Crude Oil, 1 hour, with 591 trades.
The best run had a maximum drawdown of 1,285 EUR at the tested position size, against a net result of 1,816 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.