The strategy buys when the 9-period EMA of the open crosses above the 21-period EMA of the open with short-term confirmation. It sells short on the mirror crossover, and each trade uses ATR-based stops and targets.
Best run of 5. Gold, 4 hours, spread 0.6, from run sweeps:2026-10-12-GOLD-4h-opt.tsv:64.
| Period | Up to 2026-10-12 |
| Instrument | Gold, 4 hours |
| Spread | 0.6 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 |
|---|---|---|---|---|---|---|
| GoldBest run | 4 hours | n/a | 1,217 | 32.62 | 1,727 EUR | -731 |
| Nikkei 225 | Daily | n/a | 426 | 36.15 | 25,374 USD | -11,455 |
| US Crude Oil | Daily | n/a | 460 | 36.30 | 8,372 EUR | -6,225 |
| Dow Jones | 4 hours | n/a | 409 | 32.52 | 7,433 EUR | -7,346 |
| Nasdaq 100 | Daily | n/a | 448 | 29.91 | 6,844 EUR | -5,079 |
Charts
The code
// ============================================================== // Open Based EMA Reversal Bracket // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE pos = 0 ONCE sllong = 0 ONCE slshort = 0 fastema = ExponentialAverage[9](open) slowema = ExponentialAverage[21](open) exitema = ExponentialAverage[5](open) confa = ExponentialAverage[1](open) confb = ExponentialAverage[4](open) myAtr = AverageTrueRange[5](close)
58 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 5 market and timeframe combinations. The best run by trade count was Gold, 4 hours, with 1,217 trades.
The best run had a maximum drawdown of 731 EUR at the tested position size, against a net result of 1,727 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.