Join waitlist
Strategies / Trend / EMA Stack Ride Long

EMA Stack Ride Long

The strategy buys during an uptrend when the 9, 21 and 50-period EMAs are stacked in order and the close sits 0 to 3% above the 9-period EMA. It exits when the close falls below the 21-period EMA, and uses no stop or target.

TrendLong onlySwingUS Crude Oil4 hours
n/aProfit factor
1,067Net profit EUR
50.00%Win rate
2Trades
-705Max drawdown
533Avg trade

Best run of 1. US Crude Oil, 4 hours, spread 3, from run sweeps:2026-10-03-CRUDE-4h-opt.tsv:14.

Entry rules, long

  1. The close has been above the 21-period EMA for at least 20 consecutive bars.
  2. At least 2 of the last 90 bars had a low no more than 2% above the 21-period EMA and closed above the 9-period EMA.
  3. The close is 0 to 3% above the 9-period EMA, and the 9-period EMA is higher than it was 3 bars ago.
  4. The 14-period ATR is at least 3% of price, and the close is at least 50% above the 252-bar low.
  5. When all conditions hold and no position is open, one contract is bought at market.

Exit rules

  1. No stop loss or profit target is set.

Test conditions

PeriodUp to 2026-10-03
InstrumentUS Crude Oil, 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-03

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
US Crude OilBest run4 hoursn/a 250.001,067 EUR-705

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// EMA Stack Ride Long
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE barsabove = 0

emafast = ExponentialAverage[9](close)
emamid = ExponentialAverage[21](close)
emaslow = ExponentialAverage[50](close)

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

ATREMA
Read this firstKnown weaknesses4 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The best run has only 2 trades, which is a small sample to judge it on.
  • The maximum drawdown of 705 EUR is large next to the net profit of 1,067 EUR.
  • It was only tested on US Crude Oil, so there is no evidence from other markets.

Questions

About this strategy

Can I run EMA Stack Ride Long 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 one combination, US Crude Oil, 4 hours, with 2 trades.

How large was the drawdown?

The best run had a maximum drawdown of 705 EUR at the tested position size, against a net result of 1,067 EUR.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

Short Term RSI Pullback Long Short

Best run on the same market, US Crude Oil.

1.33 PF · 493 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