Join waitlist
Strategies / Trend / SMA Slope With ADX Filter

SMA Slope With ADX Filter

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.

TrendLong & shortSwingUSD/JPYDaily
1.22Profit factor
1,876,310Net profit USD
37.49%Win rate
2,027Trades
-204,250Max drawdown
926Avg trade

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

Entry rules, long

  1. Buys 1 contract at market when no long is open, with a 0.5 percent stop and 1.0 percent target

Entry rules, short

  1. Sells 1 contract short at market when no short is open, with a 0.5 percent stop and 1.0 percent target

Exit rules

  1. The 20-bar SMA turns up while a short is open, closing the short at market
  2. A qualifying opposite signal reverses the position
  3. The 0.5 percent stop or 1.0 percent target closes the trade

Test conditions

PeriodUp to 2026-10-05
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-05

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.22 2,02737.491,876,310 USD-204,250
EUR/USDDailyn/a 1,77535.6651,268 USD-34,308
GBP/USDDailyn/a 1,88535.335,770 USD-4,898

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

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

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

ADXSMA
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 Slope With ADX 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 3 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.22 over 2,027 trades.

How large was the drawdown?

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.

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 20/50 Cross

Also a trend strategy.

1.22 PF · 1,288 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

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