Buys when the MACD line, set to 12, 26 and 9, crosses above zero, and sells when it crosses back below zero. The position is held while the MACD line stays above zero.
Best run of 4. Gold, Daily, spread 0.6, from run pf:2026-10-11-GOLD-D.tsv:8.
| Period | Up to 2026-10-11 |
| Instrument | Gold, Daily |
| Spread | 0.6 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 |
|---|---|---|---|---|---|---|
| GoldBest run | Daily | 1.82 | 240 | 31.67 | 30,559 EUR | -13,080 |
| Brent Crude | Daily | 1.76 | 85 | 35.29 | 20,653 EUR | -11,315 |
| EUR/USD | Daily | 1.55 | 202 | 36.63 | 8,780 USD | -3,425 |
| US Crude Oil | Daily | 1.47 | 195 | 38.46 | 27,078 EUR | -12,470 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // MACD Zero Line Upside Crossover // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE capital = 10000
19 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 4 market and timeframe combinations. The best run was Gold, Daily, with a profit factor of 1.82 over 240 trades.
The best run had a maximum drawdown of 13,080 EUR at the tested position size, against a net result of 30,559 EUR.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.