The strategy buys when the MACD line is above its 9 period signal line, and below the 200 period average also requires the close above the 20 period EMA. It closes when the MACD line falls below that signal.
Best run of 19. USD/JPY, 1 hour, spread 1, from run sweeps:2026-10-11-USDJPY-1h-opt.tsv:17.
| Period | Up to 2026-10-11 |
| Instrument | USD/JPY, 1 hour |
| Spread | 1 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 |
|---|---|---|---|---|---|---|
| USD/JPYBest run | 1 hour | n/a | 4,413 | 36.87 | 438,020 USD | -298,720 |
| USD/JPY | 4 hours | n/a | 1,103 | 40.25 | 665,750 USD | -345,040 |
| Nikkei 225 | Daily | n/a | 357 | 38.38 | 33,898 USD | -12,145 |
| Silver | Daily | n/a | 417 | 33.57 | 31,558 USD | -26,621 |
| Nikkei 225 | 4 hours | n/a | 807 | 39.03 | 30,108 USD | -11,583 |
| Dow Jones | Daily | n/a | 481 | 42.41 | 18,155 EUR | -6,075 |
| DAX 40 | 1 hour | n/a | 3,541 | 37.53 | 12,443 EUR | -4,804 |
| DAX 40 | 4 hours | n/a | 989 | 40.14 | 11,574 EUR | -4,264 |
| DAX 40 | Daily | n/a | 495 | 40.61 | 11,219 EUR | -4,956 |
| Nasdaq 100 | 4 hours | n/a | 996 | 39.76 | 11,105 EUR | -4,598 |
| Nasdaq 100 | Daily | n/a | 363 | 42.42 | 10,390 EUR | -5,580 |
| Dow Jones | 4 hours | n/a | 334 | 38.32 | 9,579 EUR | -7,391 |
| Nasdaq 100 | 1 hour | n/a | 3,806 | 35.31 | 5,494 EUR | -5,147 |
| FTSE 100 | Daily | n/a | 381 | 41.21 | 4,062 EUR | -2,867 |
| Gold | 4 hours | n/a | 1,006 | 39.96 | 2,582 EUR | -910 |
| Gold | Daily | n/a | 436 | 37.61 | 2,424 EUR | -1,369 |
| S&P 500 | Daily | n/a | 496 | 38.31 | 2,313 EUR | -1,057 |
| Gold | 1 hour | n/a | 3,767 | 35.28 | 2,029 EUR | -744 |
| S&P 500 | 4 hours | n/a | 1,022 | 40.02 | 1,728 EUR | -982 |
Charts
Top 10 of 19 runs. The full list is in the table above.
The code
// ============================================================== // Trend Filtered MACD Long // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: 1 hour // ============================================================== DEFPARAM CumulateOrders = false sma = Average[200](close) ema = ExponentialAverage[20](close) myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close) sig = ExponentialAverage[9](myMacd) delta = myMacd - sig
21 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 19 market and timeframe combinations. The best run by trade count was USD/JPY, 1 hour, with 4,413 trades.
The best run had a maximum drawdown of 298,720 USD at the tested position size, against a net result of 438,020 USD.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.