Join waitlist
Strategies / Trend / SMA Cross With Proximity Filter

SMA Cross With Proximity Filter

Trades crossovers of an 8 period and a 34 period simple moving average when the close sits near the fast average. Buys on an upward cross and sells short on a downward cross, and each opposite cross closes the open position.

TrendLong & shortIntradayDAX 4030 min
n/aProfit factor
11,081Net profit EUR
29.85%Win rate
4,609Trades
-6,128Max drawdown
2.40Avg trade

Best run of 5. DAX 40, 30 min, spread 3, from run sweeps:2026-10-07-DAX40-30m-opt.tsv:22.

Entry rules, long

  1. The close is less than 0.002 away from the 8 period average, measured as a fraction of that average

Entry rules, short

  1. The close is less than 0.002 away from the 8 period average, measured as a fraction of that average

Exit rules

  1. An opposite cross reverses the position only when the proximity condition also holds

Test conditions

PeriodUp to 2026-10-07
InstrumentDAX 40, 30 minutes
Spread3 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-10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
DAX 40Best run30 minn/a 4,60929.8511,081 EUR-6,128
USD/JPY1 hourn/a 3,82032.49883,720 USD-241,810
USD/JPYDailyn/a 9734.02488,910 USD-281,800
GBP/USDDailyn/a 8840.9111,405 USD-2,369
Gold4 hoursn/a 27929.391,014 EUR-518

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// SMA Cross With Proximity Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 30 minutes
// ==============================================================

DEFPARAM CumulateOrders = false

fast = Average[8](close)
slow = Average[34](close)

21 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

SMA
Read this firstKnown weaknesses3 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 6,128 EUR is large next to the net profit of 11,081 EUR.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run SMA Cross With Proximity 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 5 market and timeframe combinations. The best run by trade count was DAX 40, 30 minutes, with 4,609 trades.

How large was the drawdown?

The best run had a maximum drawdown of 6,128 EUR at the tested position size, against a net result of 11,081 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

Heikin Ashi Color Flip

Best run on the same market, DAX 40.

1.12 PF · 3,692 trades

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 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