The strategy buys a bullish engulfing bar in an uptrend, where the close is above the 15-period EMA and that EMA is above the 30-period EMA. It closes the long on a bearish signal or when the close falls below the 15-period EMA.
Best run of 12. Gold, 4 hours, spread 0.6, from run pf:2026-10-13-GOLD-4h.tsv:5.
| Period | Up to 2026-10-13 |
| 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-13 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 4 hours | 1.94 | 320 | 43.44 | 2,098 EUR | -514 |
| Nikkei 225 | 1 hour | n/a | 461 | 42.30 | 18,378 USD | -4,171 |
| Silver | Daily | n/a | 59 | 45.76 | 9,533 USD | -7,520 |
| Nasdaq 100 | 4 hours | n/a | 240 | 51.25 | 7,686 EUR | -1,937 |
| Nikkei 225 | 3 min | n/a | 1,306 | 38.28 | 7,323 USD | -3,841 |
| DAX 40 | 4 hours | n/a | 194 | 47.42 | 5,464 EUR | -2,046 |
| Nasdaq 100 | 10 min | n/a | 1,502 | 40.15 | 5,360 EUR | -2,307 |
| Nasdaq 100 | Daily | n/a | 54 | 62.96 | 5,156 EUR | -2,623 |
| Dow Jones | 4 hours | n/a | 163 | 43.56 | 4,783 EUR | -3,472 |
| Dow Jones | Daily | n/a | 39 | 46.15 | 4,766 EUR | -4,423 |
| S&P 500 | Daily | n/a | 55 | 50.91 | 613 EUR | -559 |
| Gold | 5 min | n/a | 846 | 38.77 | 445 EUR | -331 |
Charts
Top 10 of 12 runs. The full list is in the table above.
The code
// ============================================================== // Bullish Engulfing In Uptrend // ProRealAlgos Strategy Library | prorealalgos.com // Type: Pattern // Direction: Long only // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false emas = ExponentialAverage[15](close) emal = ExponentialAverage[30](close)
28 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 12 market and timeframe combinations. The best run was Gold, 4 hours, with a profit factor of 1.94 over 320 trades.
The best run had a maximum drawdown of 514 EUR at the tested position size, against a net result of 2,098 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.