The idea buys when the MACD line crosses above its signal line while the 200-period SMA is not falling, and sells short on the mirror-image cross while it is falling. Opposite signals reverse, with a 0.5 percent stop and 1.5 percent target.
Best run of 15. Gold, 10 min, spread 0.6, from run sweeps:2026-10-03-GOLD-10m-opt.tsv:14.
| Period | Up to 2026-10-03 |
| Instrument | Gold, 10 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-03 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 10 min | n/a | 2,370 | 29.37 | 824 EUR | -771 |
| USD/JPY | 15 min | n/a | 1,699 | 30.90 | 368,560 USD | -345,930 |
| USD/JPY | 10 min | n/a | 1,641 | 30.41 | 307,530 USD | -161,610 |
| USD/JPY | 3 min | n/a | 1,381 | 30.70 | 240,860 USD | -74,760 |
| USD/JPY | 5 min | n/a | 1,489 | 31.63 | 222,230 USD | -112,850 |
| EUR/USD | 2 min | n/a | 1,619 | 27.61 | 80,726 USD | -20,862 |
| EUR/USD | 3 min | n/a | 1,642 | 28.62 | 43,681 USD | -23,781 |
| EUR/USD | Daily | n/a | 523 | 27.92 | 30,496 USD | -10,255 |
| Nikkei 225 | Daily | n/a | 450 | 26.44 | 4,563 USD | -3,978 |
| Gold | 5 min | n/a | 2,012 | 30.67 | 2,674 EUR | -801 |
| DAX 40 | 4 hours | n/a | 1,131 | 26.08 | 2,544 EUR | -2,304 |
| Nasdaq 100 | Daily | n/a | 459 | 19.83 | 1,968 EUR | -1,440 |
| Gold | 4 hours | n/a | 1,138 | 26.98 | 1,243 EUR | -478 |
| Gold | 3 min | n/a | 1,917 | 29.89 | 1,218 EUR | -994 |
| Brent Crude | Daily | n/a | 206 | 26.70 | 810 EUR | -714 |
Charts
Top 10 of 15 runs. The full list is in the table above.
The code
// ============================================================== // MACD Cross Filtered By SMA // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 10 minutes // ============================================================== DEFPARAM CumulateOrders = false myMacd = MACDline[12,26,9](close) signal = ExponentialAverage[9](myMacd) sma = Average[200](close)
18 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 15 market and timeframe combinations. The best run by trade count was Gold, 10 minutes, with 2,370 trades.
The best run had a maximum drawdown of 771 EUR at the tested position size, against a net result of 824 EUR.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.