Goes long when the MACD line crosses above its 9 period signal line and short when it crosses below. Each opposite crossover reverses the position, with no stops or targets.
Best run of 5. USD/JPY, 4 hours, spread 1, from run sweeps:2026-10-03-USDJPY-4h-opt.tsv:27.
| Period | Up to 2026-10-03 |
| Instrument | USD/JPY, 4 hours |
| Spread | 1 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-03 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | 4 hours | n/a | 2,724 | 37.26 | 825,950 USD | -258,340 |
| USD/JPY | Daily | n/a | 1,094 | 34.10 | 1,139,150 USD | -981,000 |
| Silver | Daily | n/a | 1,014 | 33.04 | 32,730 USD | -26,067 |
| GBP/USD | Daily | n/a | 1,127 | 37.36 | 9,999 USD | -8,996 |
| Gold | 4 hours | n/a | 2,470 | 35.87 | 1,498 EUR | -1,336 |
Charts
The code
// ============================================================== // MACD Signal Crossover Reversal // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close) signal = ExponentialAverage[9](myMacd)
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 5 market and timeframe combinations. The best run by trade count was USD/JPY, 4 hours, with 2,724 trades.
The best run had a maximum drawdown of 258,340 USD at the tested position size, against a net result of 825,950 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.