Buys when the MACD line forms a higher low while price makes a lower low, with the MACD below zero and the 150-period EMA above the 600-period EMA. Sells short on the mirrored bearish divergence, and uses a 7% stop and a profit target.
Best run of 18. Nikkei 225, 15 min, spread 10, from run sweeps:2026-10-04-NIKKEI-15m-opt.tsv:25.
| Period | Up to 2026-10-04 |
| Instrument | Nikkei 225, 15 minutes |
| Spread | 10 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-04 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nikkei 225Best run | 15 min | n/a | 442 | 84.16 | 7,792 USD | -5,931 |
| Nikkei 225 | 4 hours | n/a | 56 | 87.50 | 14,917 USD | -2,816 |
| Nikkei 225 | 1 hour | n/a | 205 | 85.37 | 12,366 USD | -6,170 |
| Silver | 4 hours | n/a | 77 | 68.83 | 9,486 USD | -6,821 |
| Nikkei 225 | 30 min | n/a | 430 | 86.74 | 9,200 USD | -5,409 |
| Nikkei 225 | Daily | n/a | 22 | 72.73 | 8,370 USD | -3,689 |
| Dow Jones | 10 min | n/a | 412 | 91.02 | 6,746 EUR | -4,630 |
| Nasdaq 100 | 30 min | n/a | 409 | 86.80 | 5,115 EUR | -2,767 |
| Nasdaq 100 | 10 min | n/a | 402 | 89.80 | 4,792 EUR | -3,587 |
| Dow Jones | Daily | n/a | 24 | 79.17 | 4,319 EUR | -1,019 |
| DAX 40 | 4 hours | n/a | 63 | 87.30 | 3,016 EUR | -2,731 |
| FTSE 100 | Daily | n/a | 22 | 86.36 | 2,703 EUR | -563 |
| Brent Crude | 2 min | n/a | 413 | 85.96 | 2,447 EUR | -883 |
| Brent Crude | 4 hours | n/a | 42 | 76.19 | 2,411 EUR | -2,008 |
| US Crude Oil | 4 hours | n/a | 61 | 78.69 | 2,399 EUR | -2,017 |
| FTSE 100 | 10 min | n/a | 412 | 86.41 | 1,209 EUR | -694 |
| S&P 500 | Daily | n/a | 29 | 68.97 | 546 EUR | -203 |
| Gold | 4 hours | n/a | 78 | 87.18 | 506 EUR | -291 |
Charts
Top 10 of 18 runs. The full list is in the table above.
The code
// ============================================================== // MACD Divergence Trend Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Pattern // Direction: Long & short // Timeframe tested: 15 minutes // ============================================================== DEFPARAM CumulateOrders = false ONCE plosc = 0 ONCE pllow = 0 ONCE plbar = -1 ONCE phosc = 0 ONCE phhigh = 0 ONCE phbar = -1 emafast = ExponentialAverage[12](close) emaslow = ExponentialAverage[26](close) osc = emafast - emaslow emaa = ExponentialAverage[150](close) emab = ExponentialAverage[600](close) bullcond = 0 bearcond = 0
51 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 18 market and timeframe combinations. The best run by trade count was Nikkei 225, 15 minutes, with 442 trades.
The best run had a maximum drawdown of 5,931 USD at the tested position size, against a net result of 7,792 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.