Buys when the MACD line, set to 12, 26 and 9, crosses above zero and sells short when it crosses below. Each opposite crossover closes the open trade and reverses the position.
Best run of 4. EUR/USD, Daily, spread 1.2, from run pf:2026-10-10-EURUSD-D.tsv:21.
| Period | Up to 2026-10-10 |
| Instrument | EUR/USD, Daily |
| Spread | 1.2 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 |
|---|---|---|---|---|---|---|
| EUR/USDBest run | Daily | 1.51 | 405 | 35.56 | 17,048 USD | -4,314 |
| Brent Crude | Daily | 1.38 | 169 | 31.36 | 21,712 EUR | -15,534 |
| Gold | Daily | 1.27 | 481 | 29.52 | 20,765 EUR | -19,783 |
| GBP/USD | Daily | 1.23 | 459 | 32.24 | 9,436 USD | -6,280 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // MACD Zero Line Two-Way Crossover // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE capital = 10000
25 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 EUR/USD, Daily, with a profit factor of 1.51 over 405 trades.
The best run had a maximum drawdown of 4,314 USD at the tested position size, against a net result of 17,048 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.