Join waitlist
Strategies / Trend / SMA Cross With Custom ADX Filter

SMA Cross With Custom ADX Filter

The strategy buys when close crosses above a 15-period average while above a 59-period EMA and an 8-bar custom ADX is above 34. It sells short on the mirror cross and closes a position when close crosses the average the other way.

TrendLong & shortSwingGoldDaily
3.01Profit factor
1,729Net profit EUR
39.31%Win rate
145Trades
-328Max drawdown
11.92Avg trade

Best run of 4. Gold, Daily, spread 0.6, from run pf:2026-10-13-GOLD-D.tsv:8.

Entry rules, long

  1. The close is above the 59-period exponential average.
  2. The custom 8-bar ADX value is above 34.
  3. No long position is open, and signals start after bar 60.

Entry rules, short

  1. The close is below the 59-period exponential average.
  2. The custom 8-bar ADX value is above 34.
  3. No short position is open, and signals start after bar 60.

Exit rules

  1. A short is closed when the close crosses over the 15-period average.
  2. An opposite entry signal reverses the position.

Test conditions

PeriodUp to 2026-10-13
InstrumentGold, Daily
Spread0.6 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-13

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest runDaily3.01 14539.311,729 EUR-328
Nikkei 225Dailyn/a 8527.067,305 USD-5,975
US Crude Oil4 hoursn/a 34430.815,694 EUR-2,764
Brent Crude4 hoursn/a 27429.562,969 EUR-1,650

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// SMA Cross With Custom ADX Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

gm = Average[15](close)
sema = ExponentialAverage[59](close)

sumtr = 0
sump = 0
summ = 0
FOR myI = 1 TO 8 DO
    trc = high[myI] - low[myI]
    trp = high[myI] - close[myI - 1]
    trl = low[myI] - close[myI - 1]

45 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

SMAEMAADX
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run SMA Cross With Custom 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 4 market and timeframe combinations. The best run was Gold, Daily, with a profit factor of 3.01 over 145 trades.

How large was the drawdown?

The best run had a maximum drawdown of 328 EUR at the tested position size, against a net result of 1,729 EUR.

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

CCI Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

MACD Crossover Volatility Stop Filter

Also a trend strategy.

3.02 PF · 144 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