The strategy buys a bullish engulfing bar at the 7-bar low, or sells short a bearish engulfing bar at the 7-bar high. Each trade has a stop beyond that extreme by ATR(14), and a target at 1.5 times the stop distance.
Best run of 2. Gold, Daily, spread 0.6, from run sweeps:2026-10-11-GOLD-D-opt.tsv:124.
| Period | Up to 2026-10-11 |
| Instrument | Gold, Daily |
| 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 | Daily | n/a | 180 | 42.78 | 863 EUR | -586 |
| DAX 40 | Daily | n/a | 133 | 42.11 | 5,371 EUR | -3,968 |
Charts
The code
// ============================================================== // Engulfing Candle at Range Extreme // ProRealAlgos Strategy Library | prorealalgos.com // Type: Pattern // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false myAtr = AverageTrueRange[14](close)
19 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 2 market and timeframe combinations. The best run by trade count was Gold, Daily, with 180 trades.
The best run had a maximum drawdown of 586 EUR at the tested position size, against a net result of 863 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.