Buys when the MACD line crosses above its 9 period signal line and sells when it crosses back below. This long only strategy has no stop or target.
Best run of 18. DAX 40, 4 hours, spread 3, from run pf:2026-10-12-DAX40-4h.tsv:4.
| Period | Up to 2026-10-12 |
| 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-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| DAX 40Best run | 4 hours | 1.16 | 1,222 | 39.20 | 12,504 EUR | -3,100 |
| USD/JPY | 4 hours | n/a | 1,365 | 39.41 | 660,730 USD | -221,650 |
| USD/JPY | 1 hour | n/a | 5,399 | 35.91 | 423,300 USD | -333,040 |
| Nikkei 225 | Daily | n/a | 449 | 41.43 | 33,772 USD | -9,497 |
| Nikkei 225 | 4 hours | n/a | 1,005 | 37.51 | 29,728 USD | -10,572 |
| Silver | Daily | n/a | 507 | 32.54 | 29,365 USD | -26,587 |
| Dow Jones | Daily | n/a | 592 | 42.57 | 21,974 EUR | -6,472 |
| Nasdaq 100 | 4 hours | n/a | 1,273 | 38.33 | 12,226 EUR | -4,574 |
| DAX 40 | Daily | n/a | 632 | 40.35 | 11,733 EUR | -4,076 |
| DAX 40 | 1 hour | n/a | 4,294 | 37.40 | 11,181 EUR | -3,765 |
| Nasdaq 100 | Daily | n/a | 470 | 39.36 | 7,722 EUR | -5,528 |
| Nasdaq 100 | 1 hour | n/a | 4,693 | 35.54 | 6,366 EUR | -6,192 |
| Brent Crude | 4 hours | n/a | 710 | 38.87 | 5,160 EUR | -4,802 |
| Gold | Daily | n/a | 548 | 37.04 | 2,569 EUR | -1,424 |
| Gold | 4 hours | n/a | 1,237 | 38.48 | 2,505 EUR | -886 |
| S&P 500 | Daily | n/a | 611 | 38.95 | 2,324 EUR | -1,023 |
| S&P 500 | 4 hours | n/a | 1,273 | 39.12 | 1,625 EUR | -1,104 |
| Gold | 1 hour | n/a | 4,659 | 34.64 | 1,515 EUR | -1,089 |
Charts
Top 10 of 18 runs. The full list is in the table above.
The code
// ============================================================== // MACD Signal Line Crossover // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false myMacd = MACDline[12,26,9](close) signal = ExponentialAverage[9](myMacd) delta = myMacd - signal
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 18 market and timeframe combinations. The best run was DAX 40, 4 hours, with a profit factor of 1.16 over 1,222 trades.
The best run had a maximum drawdown of 3,100 EUR at the tested position size, against a net result of 12,504 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.