The idea buys whenever the 20-period and 200-period SMAs are both rising or flat, and sells short whenever both are falling. Trades use a 0.5 percent stop and 1.0 percent target, and re-enter on the next bar if the condition still holds.
Best run of 8. USD/JPY, Daily, spread 1, from run pf:2026-10-05-USDJPY-D.tsv:16.
| Period | Up to 2026-10-05 |
| 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-05 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.16 | 3,661 | 36.06 | 2,521,710 USD | -354,450 |
| EUR/USD | Daily | 1.13 | 3,695 | 36.18 | 173,879 USD | -26,009 |
| USD/JPY | 1 hour | n/a | 4,441 | 32.52 | 518,480 USD | -347,380 |
| USD/JPY | 15 min | n/a | 3,444 | 27.90 | 308,170 USD | -222,370 |
| EUR/USD | 3 min | n/a | 3,569 | 23.90 | 61,356 USD | -28,867 |
| EUR/USD | 2 min | n/a | 3,605 | 22.22 | 51,229 USD | -40,017 |
| GBP/USD | Daily | n/a | 3,672 | 34.97 | 13,961 USD | -5,639 |
| Gold | 5 min | n/a | 4,273 | 28.39 | 1,580 EUR | -830 |
Charts
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // Dual SMA Slope Trend // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false fast = Average[20](close) slow = Average[200](close)
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 8 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.16 over 3,661 trades.
The best run had a maximum drawdown of 354,450 USD at the tested position size, against a net result of 2,521,710 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.