Join waitlist
Strategies / Trend / SMA Cross With Long Term Filter

SMA Cross With Long Term Filter

Buys when SMA(20) crosses above SMA(50) while SMA(50) is above SMA(200). Sells when SMA(20) crosses below SMA(50) while SMA(50) is below SMA(200).

TrendLong onlySwingS&P 5001 hour
2.05Profit factor
4,209Net profit EUR
49.39%Win rate
164Trades
-710Max drawdown
25.67Avg trade

Best run of 48. S&P 500, 1 hour, spread 1, from run pf:2026-10-12-USA500-1h.tsv:9.

Entry rules, long

  1. SMA(50) is above SMA(200).
  2. Entries start after bar 200 and only when flat.

Exit rules

  1. SMA(20) crosses under SMA(50) while SMA(50) is below SMA(200), which closes the long.

Test conditions

PeriodUp to 2026-10-12
InstrumentS&P 500, 1 hour
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
S&P 500Best run1 hour2.05 16449.394,209 EUR-710
USD/JPY2 min1.42 29445.58161,440 USD-39,240
DAX 4030 min1.37 27041.8511,598 EUR-2,799
USD/JPY4 hoursn/a 4845.83612,780 USD-203,970
USD/JPY30 minn/a 27741.16484,760 USD-217,100
USD/JPY1 hourn/a 20038.50475,160 USD-224,020
USD/JPY3 minn/a 28543.51132,330 USD-112,680
Nikkei 225Dailyn/a 1361.5464,099 USD-11,665
Dow JonesDailyn/a 1877.7849,484 EUR-11,142
Nikkei 2251 hourn/a 13841.3036,455 USD-13,266
Nasdaq 100Dailyn/a 1258.3331,366 EUR-5,520
Nikkei 2255 minn/a 28940.1428,689 USD-10,387
Nikkei 2254 hoursn/a 3542.8628,612 USD-11,811
Silver30 minn/a 29833.8925,313 USD-23,383
DAX 40Dailyn/a 1782.3523,436 EUR-5,511
Nikkei 2253 minn/a 27641.3022,123 USD-11,154
Nikkei 22530 minn/a 27843.1720,937 USD-13,721
Silver15 minn/a 30440.7920,720 USD-16,742
Silver5 minn/a 29840.9417,641 USD-14,999
Nikkei 2252 minn/a 28940.4814,846 USD-9,286
Nasdaq 1004 hoursn/a 4160.9814,140 EUR-3,773
Silver10 minn/a 30138.5413,882 USD-12,797
Nasdaq 10015 minn/a 27946.2410,818 EUR-5,671
Nasdaq 1001 hourn/a 17441.389,952 EUR-6,321
Nikkei 2251 minn/a 30538.369,808 USD-5,374
FTSE 100Dailyn/a 1573.339,588 EUR-1,530
Dow Jones1 hourn/a 6547.699,245 EUR-8,175
Dow Jones3 minn/a 28538.608,857 EUR-5,668
DAX 401 hourn/a 16548.488,781 EUR-4,752
S&P 500Dailyn/a 1668.758,070 EUR-1,238
Dow Jones2 minn/a 27340.667,893 EUR-2,333
Nasdaq 1005 minn/a 28941.877,344 EUR-3,593
DAX 405 minn/a 28642.666,933 EUR-4,377
Brent Crude4 hoursn/a 2958.626,715 EUR-5,221
US Crude Oil4 hoursn/a 3458.826,517 EUR-3,202
DAX 403 minn/a 28443.663,687 EUR-2,880
GoldDailyn/a 1942.113,486 EUR-1,534
US Crude Oil2 minn/a 28339.933,283 EUR-2,585
Gold30 minn/a 28538.602,885 EUR-1,100
Gold1 hourn/a 16847.022,840 EUR-1,315
Gold5 minn/a 29342.662,584 EUR-689
Gold15 minn/a 31937.932,276 EUR-696
S&P 5004 hoursn/a 4358.142,184 EUR-1,205
Gold4 hoursn/a 4454.552,133 EUR-1,345
Gold2 minn/a 30340.922,005 EUR-575
Gold3 minn/a 29442.861,960 EUR-749
S&P 50030 minn/a 27252.571,926 EUR-902
Gold10 minn/a 30140.861,619 EUR-858

Charts

Results by run

Top 10 of 48 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 Cross With Long Term Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

mashort = Average[20](close)
mamedium = Average[50](close)
malong = Average[200](close)

9 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 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 Long Term 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 48 market and timeframe combinations. The best run was S&P 500, 1 hour, with a profit factor of 2.05 over 164 trades.

How large was the drawdown?

The best run had a maximum drawdown of 710 EUR at the tested position size, against a net result of 4,209 EUR.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

EMA 20 55 Crossover Reversal

Also a trend strategy.

2.05 PF · 212 trades

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

Copy trading on US indices is available to ProRealAlgos members as spots open.

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