Join waitlist
Strategies / Trend / EMA Stack Crossover Trend

EMA Stack Crossover Trend

It buys when the 5 EMA crosses above the 10 EMA in a bullish 5, 10, 20 EMA stack, with close above the 20 and 50 SMAs. Stop and target are set from the distance to the 20 EMA, with a 1.5 reward ratio.

TrendLong & shortSwingGoldDaily
n/aProfit factor
571Net profit EUR
36.83%Win rate
353Trades
-287Max drawdown
1.62Avg trade

Best run of 2. Gold, Daily, spread 0.6, from run sweeps:2026-10-11-GOLD-D-opt.tsv:23.

Entry rules, long

  1. Close is above the 5 period EMA, which is above the 10 period EMA, which is above the 20 period EMA.
  2. Close is above the 20 and 50 period simple moving averages.
  3. At least 3 bars have passed since the last position was closed.
  4. Signals are checked only after bar 60.

Entry rules, short

  1. Close is below the 5 period EMA, which is below the 10 period EMA, which is below the 20 period EMA.
  2. Close is below the 20 and 50 period simple moving averages.
  3. At least 3 bars have passed since the last position was closed.
  4. Signals are checked only after bar 60.

Exit rules

  1. A long closes at a target 1.5 times that distance above the entry.
  2. A short mirrors both levels, with its stop above entry and target below.
  3. An opposite signal reverses the position.

Test conditions

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

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest runDailyn/a 35336.83571 EUR-287
SilverDailyn/a 32931.316,671 USD-5,518

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// EMA Stack Crossover Trend
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE barsflat = 1000000
ONCE wason = 0

emafive = ExponentialAverage[5](close)
ematen = ExponentialAverage[10](close)
ematwenty = ExponentialAverage[20](close)
smatwenty = Average[20](close)
smafifty = Average[50](close)

barsflat = barsflat + 1
IF wason = 1 AND NOT OnMarket THEN
    barsflat = 0
ENDIF

26 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 287 EUR is large next to the net profit of 571 EUR.

Questions

About this strategy

Can I run EMA Stack Crossover Trend 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 2 market and timeframe combinations. The best run by trade count was Gold, Daily, with 353 trades.

How large was the drawdown?

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

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