Buys when a reversal pattern on closing prices and a close above a volatility-based stop level both point up, and sells short when both point down. Positions are closed when the two signals disagree.
Best run of 3. Gold, 4 hours, spread 0.6, from run sweeps:2026-10-11-GOLD-4h-opt.tsv:109.
| Period | Up to 2026-10-11 |
| 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-11 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 4 hours | n/a | 1,220 | 30.33 | 1,262 EUR | -974 |
| USD/JPY | Daily | n/a | 663 | 28.66 | 1,751,490 USD | -494,900 |
| Silver | 4 hours | n/a | 1,219 | 29.04 | 30,398 USD | -10,944 |
Charts
The code
// ============================================================== // Reversal With Deviation Stop Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false ONCE posrev = 0 ONCE sincebad = 1000 ONCE postwo = 0 ONCE rwh = 0 ONCE rwl = 0 ll = lowest[14](low) hh = highest[14](high)
62 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 Gold, 4 hours, with 1,220 trades.
The best run had a maximum drawdown of 974 EUR at the tested position size, against a net result of 1,262 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.