Join waitlist
Strategies / Trend / Regime Switched Moving Average Crossover

Regime Switched Moving Average Crossover

Buys when a short moving average crosses above a long moving average, with the pair chosen by the 20-period EMA slope and close position. Closes the long when the short average crosses back below the long average.

TrendLong onlySwingNasdaq 1004 hours
1.42Profit factor
25,029Net profit EUR
49.81%Win rate
1,614Trades
-5,239Max drawdown
15.51Avg trade

Best run of 14. Nasdaq 100, 4 hours, spread 3, from run pf:2026-10-13-NAS100-4h.tsv:2.

Entry rules, long

  1. Slope rising and close below EMA(20): RMA(16) crosses above HMA(59).
  2. Slope falling and close above EMA(20): SMA(19) crosses above RMA(45).
  3. Slope falling and close below EMA(20): EMA(15) crosses above HMA(24).

Exit rules

  1. The selected short average crosses below the selected long average, closing the long.

Test conditions

PeriodUp to 2026-10-13
InstrumentNasdaq 100, 4 hours
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-13

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best run4 hours1.42 1,61449.8125,029 EUR-5,239
USD/JPY4 hoursn/a 1,96451.12666,110 USD-331,130
Nikkei 225Dailyn/a 64650.9337,009 USD-30,326
Nikkei 2254 hoursn/a 1,40747.7633,944 USD-14,965
Dow JonesDailyn/a 85251.5330,889 EUR-8,985
Silver4 hoursn/a 1,59850.4426,698 USD-15,432
Nasdaq 100Dailyn/a 62445.5115,324 EUR-5,607
Dow Jones1 hourn/a 2,15750.8614,648 EUR-8,506
Dow Jones4 hoursn/a 55548.4713,134 EUR-8,943
DAX 404 hoursn/a 1,60050.6212,231 EUR-7,244
DAX 40Dailyn/a 79746.058,054 EUR-7,644
S&P 5004 hoursn/a 1,67450.003,602 EUR-1,290
S&P 500Dailyn/a 81045.563,288 EUR-1,239
GoldDailyn/a 76149.012,592 EUR-1,778

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Regime Switched Moving Average Crossover
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

base = ExponentialAverage[20](close)
slope = base - base[1]

hraw = 2 * WeightedAverage[12](close) - WeightedAverage[24](close)
hmaa = WeightedAverage[4](hraw)
hrawb = 2 * WeightedAverage[29](close) - WeightedAverage[59](close)
hmab = WeightedAverage[7](hrawb)
emaf = ExponentialAverage[15](close)
smaf = Average[19](close)
rmas = WilderAverage[45](close)
rmaf = WilderAverage[16](close)
rmag = WilderAverage[12](close)
rmah = WilderAverage[36](close)

28 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

EMASMAWMAHull MAWilder Average
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 Regime Switched Moving Average Crossover 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 14 market and timeframe combinations. The best run was Nasdaq 100, 4 hours, with a profit factor of 1.42 over 1,614 trades.

How large was the drawdown?

The best run had a maximum drawdown of 5,239 EUR at the tested position size, against a net result of 25,028 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

Volatility Spike Regression Long

Best run on the same market, Nasdaq 100.

1.22 PF · 1,850 trades

QQE Channel Exit Trend

Also a trend strategy.

1.42 PF · 319 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