The strategy buys when the close is above a 255-period EMA band and the MACD line crosses above its signal line, and sells short on the mirror condition. Each trade sets its stop and target from the 10-bar swing low or high at entry.
Best run of 10. Gold, 5 min, spread 0.6, from run pf:2026-10-12-GOLD-5m.tsv:1.
| Period | Up to 2026-10-12 |
| Instrument | Gold, 5 minutes |
| 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 | 5 min | 1.26 | 613 | 49.92 | 2,534 EUR | -589 |
| USD/JPY | 4 hours | n/a | 464 | 53.23 | 133,860 USD | -57,840 |
| Silver | 2 min | n/a | 767 | 45.76 | 22,634 USD | -9,411 |
| Nikkei 225 | Daily | n/a | 109 | 50.46 | 12,656 USD | -11,220 |
| Gold | 15 min | n/a | 752 | 47.87 | 2,147 EUR | -688 |
| Gold | 4 hours | n/a | 216 | 45.37 | 1,510 EUR | -519 |
| Gold | 10 min | n/a | 709 | 47.53 | 1,364 EUR | -632 |
| S&P 500 | Daily | n/a | 147 | 51.02 | 1,300 EUR | -1,058 |
| Gold | 3 min | n/a | 609 | 51.23 | 1,152 EUR | -1,011 |
| Gold | 1 min | n/a | 564 | 53.90 | 556 EUR | -518 |
Charts
The code
// ============================================================== // EMA Band MACD Swing Bracket // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 5 minutes // ============================================================== DEFPARAM CumulateOrders = false ONCE prevlong = 0 ONCE prevshort = 0 ema = ExponentialAverage[255](close) myAtr = AverageTrueRange[100](close) upper = ema + myAtr * 5 lower = ema - myAtr * 5 myMacdline = MACDline[12,26,9](close) macdsig = ExponentialAverage[9](myMacdline) swinglow = lowest[10](low) swinghigh = highest[10](high)
32 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 10 market and timeframe combinations. The best run was Gold, 5 minutes, with a profit factor of 1.26 over 613 trades.
The best run had a maximum drawdown of 589 EUR at the tested position size, against a net result of 2,534 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.