The idea buys when the MACD line crosses above its signal line and sells short when it crosses below. Each opposite cross closes and reverses the position, with a 0.5 percent stop and a 1.5 percent target.
Best run of 4. USD/JPY, 4 hours, spread 1, from run pf:2026-10-05-USDJPY-4h.tsv:2.
| Period | Up to 2026-10-05 |
| 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-05 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | 4 hours | 1.13 | 2,727 | 33.88 | 975,410 USD | -170,630 |
| USD/JPY | 1 hour | n/a | 10,786 | 33.90 | 668,070 USD | -259,810 |
| DAX 40 | 4 hours | n/a | 2,441 | 28.19 | 7,687 EUR | -3,619 |
| GBP/USD | Daily | n/a | 1,127 | 27.15 | 5,041 USD | -4,222 |
Charts
The code
// ============================================================== // MACD Signal Cross Reversal // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 4 hours // ============================================================== DEFPARAM CumulateOrders = false myMacd = MACDline[12,26,9](close) macdsig = ExponentialAverage[9](myMacd)
16 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 USD/JPY, 4 hours, with a profit factor of 1.13 over 2,727 trades.
The best run had a maximum drawdown of 170,630 USD at the tested position size, against a net result of 975,410 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.