The idea buys when the 20-period SMA is not falling, ADX is above 25 and the 200-period SMA is not falling, and sells short when both SMAs are falling with ADX above 25. Trades use a 0.5 percent stop and 1.0 percent target.
Best run of 3. USD/JPY, Daily, spread 1, from run pf:2026-10-05-USDJPY-D.tsv:15.
| 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.22 | 2,027 | 37.49 | 1,876,310 USD | -204,250 |
| EUR/USD | Daily | n/a | 1,775 | 35.66 | 51,268 USD | -34,308 |
| GBP/USD | Daily | n/a | 1,885 | 35.33 | 5,770 USD | -4,898 |
Charts
The code
// ============================================================== // SMA Slope With ADX Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false sig = Average[20](close) trend = Average[200](close) myAdx = ADX[14]
30 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 1.22 over 2,027 trades.
The best run had a maximum drawdown of 204,250 USD at the tested position size, against a net result of 1,876,310 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.