The strategy buys 1 contract when the MACD histogram crosses above zero and closes the long when it crosses below zero. The MACD uses 3 and 7 period exponential averages with a 5 period signal line.
Best run of 7. DAX 40, 4 hours, spread 3, from run pf:2026-10-13-DAX40-4h.tsv:6.
| Period | Up to 2026-10-13 |
| Instrument | DAX 40, 4 hours |
| 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-13 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| DAX 40Best run | 4 hours | 1.15 | 3,292 | 40.10 | 19,243 EUR | -4,031 |
| Nikkei 225 | 4 hours | n/a | 2,783 | 37.37 | 15,649 USD | -11,563 |
| Dow Jones | 4 hours | n/a | 1,149 | 40.30 | 10,877 EUR | -9,676 |
| Nasdaq 100 | 4 hours | n/a | 3,472 | 38.28 | 9,586 EUR | -4,305 |
| DAX 40 | Daily | n/a | 1,676 | 39.74 | 6,229 EUR | -5,281 |
| Gold | 4 hours | n/a | 3,479 | 37.60 | 2,498 EUR | -980 |
| S&P 500 | Daily | n/a | 1,719 | 38.34 | 1,554 EUR | -1,322 |
Charts
The code
// ============================================================== // MACD Histogram Zero Cross // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false line = ExponentialAverage[3](close) - ExponentialAverage[7](close) signal = ExponentialAverage[5](line) hist = line - signal
9 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 7 market and timeframe combinations. The best run was DAX 40, 4 hours, with a profit factor of 1.15 over 3,292 trades.
The best run had a maximum drawdown of 4,031 EUR at the tested position size, against a net result of 19,243 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.