The strategy goes long when a 13 and 19 period MACD line crosses above zero. It goes short when an 11 and 20 period MACD line crosses below zero, with a 21% stop and 20% target.
Best run of 9. USD/JPY, Daily, spread 1, from run pf:2026-10-11-USDJPY-D.tsv:6.
| Period | Up to 2026-10-11 |
| 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-11 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.48 | 480 | 35.00 | 2,884,240 USD | -600,670 |
| USD/JPY | 1 hour | n/a | 5,025 | 32.10 | 825,300 USD | -321,910 |
| EUR/USD | Daily | n/a | 437 | 39.13 | 158,843 USD | -43,645 |
| Nikkei 225 | Daily | n/a | 412 | 33.25 | 50,852 USD | -16,245 |
| Nasdaq 100 | Daily | n/a | 409 | 31.30 | 13,405 EUR | -7,227 |
| Gold | 4 hours | n/a | 1,103 | 34.18 | 3,593 EUR | -1,143 |
| Gold | Daily | n/a | 519 | 32.95 | 2,789 EUR | -998 |
| Gold | 1 hour | n/a | 4,343 | 30.85 | 2,332 EUR | -1,165 |
| S&P 500 | Daily | n/a | 551 | 30.13 | 1,455 EUR | -1,276 |
Charts
The code
// ============================================================== // Bidirectional MACD Zero Line Cross // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false macdlong = ExponentialAverage[13](close) - ExponentialAverage[19](close) macdshort = ExponentialAverage[11](close) - ExponentialAverage[20](close)
18 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 9 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.48 over 480 trades.
The best run had a maximum drawdown of 600,670 USD at the tested position size, against a net result of 2,884,240 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.