The strategy buys when the MACD histogram crosses above zero, using 20 and 40 period EMAs and a 4 period signal. It closes the long when the histogram crosses below zero.
Best run of 15. Dow Jones, Daily, spread 3, from run pf:2026-10-12-DOW30-D.tsv:18.
| Period | Up to 2026-10-12 |
| Instrument | Dow Jones, Daily |
| Spread | 3 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 |
|---|---|---|---|---|---|---|
| Dow JonesBest run | Daily | 1.39 | 637 | 38.62 | 23,453 EUR | -4,479 |
| DAX 40 | Daily | 1.34 | 656 | 39.02 | 14,088 EUR | -3,457 |
| USD/JPY | 1 hour | n/a | 5,796 | 32.64 | 531,790 USD | -315,140 |
| Nikkei 225 | Daily | n/a | 489 | 35.38 | 32,701 USD | -12,942 |
| Silver | Daily | n/a | 520 | 32.50 | 32,018 USD | -27,668 |
| Nikkei 225 | 4 hours | n/a | 1,073 | 35.41 | 31,580 USD | -10,573 |
| Silver | 4 hours | n/a | 1,270 | 32.68 | 30,715 USD | -14,508 |
| DAX 40 | 4 hours | n/a | 1,268 | 37.30 | 13,554 EUR | -3,765 |
| DAX 40 | 1 hour | n/a | 4,516 | 33.72 | 10,550 EUR | -4,858 |
| Nasdaq 100 | Daily | n/a | 501 | 36.33 | 10,383 EUR | -4,528 |
| Nasdaq 100 | 4 hours | n/a | 1,371 | 35.81 | 7,416 EUR | -4,229 |
| Gold | Daily | n/a | 566 | 35.87 | 2,802 EUR | -1,352 |
| Gold | 4 hours | n/a | 1,306 | 35.30 | 2,688 EUR | -1,026 |
| S&P 500 | Daily | n/a | 679 | 34.90 | 2,369 EUR | -901 |
| Gold | 1 hour | n/a | 4,961 | 31.49 | 1,477 EUR | -1,254 |
Charts
Top 10 of 15 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // MACD Histogram Zero Line Long // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false myMacd = ExponentialAverage[20](close) - ExponentialAverage[40](close) amacd = ExponentialAverage[4](myMacd) delta = myMacd - amacd
10 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 was Dow Jones, Daily, with a profit factor of 1.39 over 637 trades.
The best run had a maximum drawdown of 4,479 EUR at the tested position size, against a net result of 23,453 EUR.
It only takes long trades.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.