Buys on a regular bullish MACD divergence while the 150-period EMA is above the 600-period EMA. Sells short on the mirrored bearish divergence, with stops at the 10-bar extreme and targets at 1.5 times the stop distance.
Best run of 9. Gold, 1 hour, spread 0.6, from run sweeps:2026-10-04-GOLD-1h-opt.tsv:34.
| Period | Up to 2026-10-04 |
| Instrument | Gold, 1 hour |
| 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 1 hour | n/a | 511 | 42.47 | 1,059 EUR | -395 |
| Dow Jones | 4 hours | n/a | 47 | 48.94 | 9,926 EUR | -2,819 |
| Nikkei 225 | Daily | n/a | 33 | 57.58 | 8,847 USD | -3,832 |
| Nikkei 225 | 4 hours | n/a | 103 | 39.81 | 6,850 USD | -6,295 |
| Dow Jones | Daily | n/a | 49 | 42.86 | 6,085 EUR | -2,585 |
| US Crude Oil | 1 hour | n/a | 358 | 43.58 | 3,790 EUR | -2,294 |
| Nasdaq 100 | 4 hours | n/a | 113 | 37.17 | 3,305 EUR | -1,697 |
| US Crude Oil | 4 hours | n/a | 108 | 37.96 | 1,910 EUR | -1,328 |
| Gold | 4 hours | n/a | 126 | 43.65 | 401 EUR | -159 |
Charts
The code
// ============================================================== // Regular MACD Divergence Trend // ProRealAlgos Strategy Library | prorealalgos.com // Type: Pattern // Direction: Long & short // Timeframe tested: 1 hour // ============================================================== DEFPARAM CumulateOrders = false ONCE lastplosc = 0 ONCE lastpllow = 0 ONCE lastplbar = -1 ONCE lastphosc = 0 ONCE lastphhigh = 0 ONCE lastphbar = -1 ONCE slbuy = 0 ONCE slsell = 0 osc = ExponentialAverage[12](close) - ExponentialAverage[26](close) emaa = ExponentialAverage[150](close) emab = ExponentialAverage[600](close)
64 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 9 market and timeframe combinations. The best run by trade count was Gold, 1 hour, with 511 trades.
The best run had a maximum drawdown of 395 EUR at the tested position size, against a net result of 1,058 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.