Join waitlist
Strategies / Trend / Stacked Moving Average Turn

Stacked Moving Average Turn

The strategy buys when the close crosses from below to at or above its 21-bar average while moving averages are stacked upward. It sells short on the mirror setup, with a stop at the 90-bar SMA and a target 1.5 times that distance.

TrendLong & shortSwingNasdaq 1004 hours
n/aProfit factor
7,086Net profit EUR
39.95%Win rate
403Trades
-5,562Max drawdown
17.58Avg trade

Best run of 4. Nasdaq 100, 4 hours, spread 3, from run sweeps:2026-10-12-NAS100-4h-opt.tsv:72.

Entry rules, long

  1. The 45-bar EMA is above the 90-bar SMA, and the 90-bar SMA is above the 180-bar SMA.
  2. The risk distance, the close minus the 90-bar SMA, must be positive for the trade to open.
  3. Buys one contract at market when flat, after bar 185.

Entry rules, short

  1. The 45-bar EMA is below the 90-bar SMA, and the 90-bar SMA is below the 180-bar SMA.
  2. The risk distance, the 90-bar SMA minus the close, must be positive for the trade to open.
  3. Sells short one contract at market when flat, after bar 185.

Exit rules

  1. A profit target is placed at 1.5 times that risk distance from the entry.
  2. An opposite signal closes the trade and reverses it.

Test conditions

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

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best run4 hoursn/a 40339.957,086 EUR-5,562
Nikkei 225Dailyn/a 14042.1426,356 USD-13,529
Nasdaq 100Dailyn/a 15139.0711,287 EUR-5,903
US Crude Oil4 hoursn/a 28941.878,371 EUR-4,304

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Stacked Moving Average Turn
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

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

EMASMA
Read this firstKnown weaknesses2 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 5,562 EUR is large next to the net profit of 7,086 EUR.

Questions

About this strategy

Can I run Stacked Moving Average Turn 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 by trade count was Nasdaq 100, 4 hours, with 403 trades.

How large was the drawdown?

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

Volatility Spike Regression Long

Best run on the same market, Nasdaq 100.

1.22 PF · 1,850 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.

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