This is the textbook MACD signal: buy when the MACD(12, 26, 9) line crosses above its signal line, sell short on the cross below. Positions close when the lines point the other way or at a 1% stop. In our tests it mostly lost money.
Best run of 17. DAX 40, 5 min, spread 3, from run sweeps:2026-09-07-DAX40-5m-opt.tsv:11.
| Period | Up to 2026-09-07 |
| Instrument | DAX 40, 5 minutes |
| Spread | 3 points |
| Contracts | 1 |
| 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-09-08 |
| positionSize Contracts per trade | 1 |
| macdFast MACD fast EMA length | 12 |
| macdSlow MACD slow EMA length | 26 |
| macdSignalPeriod MACD signal line length | 9 |
| stopLossPct Protective stop, percent of entry price | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| DAX 40Best run | 5 min | n/a | 8,088 | 28.10 | -29,036 EUR | -29,225 |
| S&P 500 | 4 hours | n/a | 1,466 | 32.95 | 1,625 EUR | -1,222 |
| DAX 40 | 1 hour | n/a | 4,577 | 34.30 | 626 EUR | -8,984 |
| Gold | 1 hour | n/a | 4,845 | 32.07 | -675 EUR | -2,269 |
| Gold | 30 min | n/a | 7,774 | 31.79 | -2,127 EUR | -4,636 |
| S&P 500 | 30 min | n/a | 7,543 | 32.43 | -3,922 EUR | -6,581 |
| Gold | 5 min | n/a | 7,926 | 28.50 | -5,364 EUR | -5,743 |
| Gold | 15 min | n/a | 7,810 | 29.54 | -5,724 EUR | -6,028 |
| S&P 500 | 15 min | n/a | 7,609 | 31.06 | -5,934 EUR | -6,007 |
| S&P 500 | 1 hour | n/a | 5,037 | 30.85 | -6,508 EUR | -6,917 |
| S&P 500 | 5 min | n/a | 7,965 | 28.06 | -8,301 EUR | -8,317 |
| Nasdaq 100 | 1 hour | n/a | 5,108 | 31.34 | -11,045 EUR | -11,629 |
| Nasdaq 100 | 15 min | n/a | 7,482 | 32.58 | -16,254 EUR | -18,183 |
| Nasdaq 100 | 30 min | n/a | 7,610 | 31.27 | -16,604 EUR | -16,782 |
| DAX 40 | 30 min | n/a | 7,697 | 32.58 | -18,070 EUR | -19,902 |
| Nasdaq 100 | 5 min | n/a | 7,861 | 30.73 | -22,076 EUR | -22,223 |
| DAX 40 | 15 min | n/a | 7,808 | 31.71 | -24,690 EUR | -24,944 |
Charts
Top 10 of 17 runs. The full list is in the table above.
The code
// ============================================================ // MACD Signal Cross // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: 5 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade macdFast = 12 // MACD fast EMA length macdSlow = 26 // MACD slow EMA length macdSignalPeriod = 9 // MACD signal line length stopLossPct = 1 // protective stop, percent of entry price // --- Indicators --- // Names differ from MACDLine / MACDSignal because ProBuilder ignores case. macdMain = MACDLine[macdFast, macdSlow, macdSignalPeriod](close) macdTrigger = MACDSignal[macdFast, macdSlow, macdSignalPeriod](close)
25 more lines: the entry and exit rules.
Setup
Questions
It can be loaded into ProOrder, but the backtests on this page do not support trading it as it stands. Treat it as a baseline to improve.
S&P 500 4 hours made 1,624.76 EUR and DAX 40 1 hour made 626 EUR. Every other row lost, with the worst at -24,689.5 EUR on DAX 40 15 minutes.
On DAX 40 5 minutes the drawdown was 29,225.3 EUR at 1 contract, about the size of the full loss.
MACD crosses are popular with intraday traders. The results suggest the signal fires too often on 5 to 30 minute charts and costs pile up.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.