Join waitlist
Strategies / Trend / SMA Crossover ATR Stop Reversal

SMA Crossover ATR Stop Reversal

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.

TrendLong & shortSwingUSD/JPYDaily
1.58Profit factor
2,447,240Net profit USD
34.11%Win rate
343Trades
-450,010Max drawdown
7,135Avg trade

Best run of 10. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:40.

Entry rules, long

  1. SMA(15) crosses over SMA(45).

Entry rules, short

  1. SMA(15) crosses under SMA(45).

Exit rules

  1. Stops apply only after both a long cross and a short cross have occurred.
  2. A short stop sits at the signal close plus 2 times the 14-period ATR, and the short closes when the high crosses over it.
  3. An opposite cross closes the trade and reverses it.

Test conditions

PeriodUp to 2026-10-12
InstrumentUSD/JPY, Daily
Spread1 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.58 34334.112,447,240 USD-450,010
USD/JPY30 minn/a 5,09530.34460,770 USD-218,280
USD/JPY1 hourn/a 3,59731.14363,480 USD-298,290
EUR/USDDailyn/a 31132.1586,357 USD-41,909
Brent CrudeDailyn/a 12634.1320,843 EUR-5,357
US Crude OilDailyn/a 28934.9519,138 EUR-10,900
GBP/USDDailyn/a 32829.5716,134 USD-7,929
GoldDailyn/a 39131.202,613 EUR-1,061
Gold30 minn/a 5,14028.352,074 EUR-1,294
Gold4 hoursn/a 76131.411,410 EUR-1,385

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// 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

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

SMAATR
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run SMA Crossover ATR Stop Reversal in ProOrder?

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.

Which markets was it tested on?

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.

How large was the drawdown?

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.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

EMA 8 21 RSI Filtered Bracket

Best run on the same market, USD/JPY.

1.09 PF · 6,194 trades

EMA 50/200 Cross With Stop

Also a trend strategy.

1.58 PF · 304 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs