Join waitlist
Strategies / Trend / SMA Crossover ATR Bracket Trend Filter

SMA Crossover ATR Bracket Trend Filter

The strategy buys when the 9-bar average crosses above the 21-bar average with price above the 200-bar average, and sells short on the mirror crossover below it. Each signal sets a stop 2 times ATR(14) away and a target at double that distance.

TrendLong & shortSwingUSD/JPYDaily
1.58Profit factor
24,340Net profit USD
40.88%Win rate
340Trades
-2,300Max drawdown
71.59Avg trade

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

Entry rules, long

  1. The close is above the 200-bar simple moving average

Entry rules, short

  1. The close is below the 200-bar simple moving average

Exit rules

  1. A repeat signal in the same direction re-sets the stop and target from the signal bar's close
  2. An opposite signal reverses the position

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 34040.8824,340 USD-2,300
US Crude Oil4 hours1.23 50337.5710,385 EUR-2,549
Dow JonesDailyn/a 29736.039,593 EUR-5,268
Brent Crude4 hoursn/a 38138.328,806 EUR-4,036
Nasdaq 100Dailyn/a 23636.027,962 EUR-6,313
Dow Jones4 hoursn/a 23237.506,549 EUR-6,508
DAX 40Dailyn/a 32937.395,973 EUR-5,757
Nasdaq 1004 hoursn/a 71233.434,049 EUR-3,244
S&P 500Dailyn/a 33335.142,382 EUR-789
Gold1 hourn/a 2,67333.411,518 EUR-1,187
GoldDailyn/a 29741.411,438 EUR-828
S&P 5004 hoursn/a 68833.581,194 EUR-774

Charts

Results by run

Top 10 of 12 runs. The full list is in the table above.

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// SMA Crossover ATR Bracket Trend Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

fast = Average[9](close)
slow = Average[21](close)
trend = Average[200](close)
myAtr = AverageTrueRange[14](close)
sl = myAtr * 2
tp = myAtr * 2 * 2

26 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 Bracket Trend Filter 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 12 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.58 over 340 trades.

How large was the drawdown?

The best run had a maximum drawdown of 2,300 USD at the tested position size, against a net result of 24,340 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

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

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