The strategy goes long when the MACD histogram crosses above zero and short when it crosses below zero, reversing any open position. Each trade uses a stop loss 1.25 times the 2 period average true range.
Best run of 3. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:3.
| Period | Up to 2026-10-12 |
| Instrument | USD/JPY, Daily |
| 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-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 9.12 | 893 | 1.46 | 1,149,270 USD | -133,510 |
| Silver | 4 hours | n/a | 2,032 | 26.57 | 33,074 USD | -20,413 |
| Gold | 4 hours | n/a | 2,036 | 28.88 | 2,350 EUR | -1,439 |
Charts
The code
// ============================================================== // MACD Histogram Zero Cross Reversal // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false myMacd = ExponentialAverage[13](close) - ExponentialAverage[30](close) signal = ExponentialAverage[12](myMacd) delta = myMacd - signal myAtr = AverageTrueRange[2](close)
13 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 3 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 9.12 over 893 trades.
The best run had a maximum drawdown of 133,510 USD at the tested position size, against a net result of 1,149,270 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.