It buys when SMA(15) crosses above SMA(45) and sells short on the cross below, reversing each time. Each stop sits 2 times ATR(14) from the signal close, and the trade closes when price crosses through it.
Best run of 10. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:40.
| 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 | 1.58 | 343 | 34.11 | 2,447,240 USD | -450,010 |
| USD/JPY | 30 min | n/a | 5,095 | 30.34 | 460,770 USD | -218,280 |
| USD/JPY | 1 hour | n/a | 3,597 | 31.14 | 363,480 USD | -298,290 |
| EUR/USD | Daily | n/a | 311 | 32.15 | 86,357 USD | -41,909 |
| Brent Crude | Daily | n/a | 126 | 34.13 | 20,843 EUR | -5,357 |
| US Crude Oil | Daily | n/a | 289 | 34.95 | 19,138 EUR | -10,900 |
| GBP/USD | Daily | n/a | 328 | 29.57 | 16,134 USD | -7,929 |
| Gold | Daily | n/a | 391 | 31.20 | 2,613 EUR | -1,061 |
| Gold | 30 min | n/a | 5,140 | 28.35 | 2,074 EUR | -1,294 |
| Gold | 4 hours | n/a | 761 | 31.41 | 1,410 EUR | -1,385 |
Charts
The code
// ============================================================== // SMA Crossover ATR Stop Reversal // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE trend = 0 ONCE hadlong = 0 ONCE hadshort = 0 ONCE entryprice = 0 ONCE entrydist = 0 ONCE longstop = 0 ONCE shortstop = 99999 fast = Average[15](close) slow = Average[45](close) myAtr = AverageTrueRange[14](close)
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 10 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.58 over 343 trades.
The best run had a maximum drawdown of 450,010 USD at the tested position size, against a net result of 2,447,240 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.