Join waitlist
Strategies / Trend / EMA Stack Crossover Bias

EMA Stack Crossover Bias

It buys when the 5, 20, 50, 90, 140 and 200 period EMAs are in bullish order and either the 5 crosses over the 20 or the stack has just formed. It sells short on the mirror setup, and an opposite signal reverses it.

TrendLong & shortSwingUSD/JPYDaily
1.75Profit factor
2,106,160Net profit USD
34.87%Win rate
304Trades
-396,900Max drawdown
6,928Avg trade

Best run of 11. USD/JPY, Daily, spread 1, from run pf:2026-10-10-USDJPY-D.tsv:4.

Entry rules, long

  1. The 5-period EMA is above the 20, 50, 90, 140 and 200-period EMAs, each one ranked in descending order.

Entry rules, short

  1. The 5-period EMA is below the 20, 50, 90, 140 and 200-period EMAs, each one ranked in ascending order.

Exit rules

  1. A short closes when the 5-period EMA crosses over the 20-period EMA, unless a long signal also fires.
  2. An opposite entry signal reverses the position.

Test conditions

PeriodUp to 2026-10-10
InstrumentUSD/JPY, Daily
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-10

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.75 30434.872,106,160 USD-396,900
USD/JPY1 hourn/a 3,32129.33422,120 USD-229,050
EUR/USDDailyn/a 30735.83126,588 USD-38,020
Nikkei 225Dailyn/a 25835.2742,993 USD-12,867
Silver4 hoursn/a 72528.6917,399 USD-15,448
Nasdaq 100Dailyn/a 28334.6313,446 EUR-4,666
GoldDailyn/a 34531.592,379 EUR-809
Gold1 hourn/a 2,79029.142,156 EUR-941
Gold4 hoursn/a 72231.581,996 EUR-904
Gold30 minn/a 4,81327.241,739 EUR-1,502
S&P 500Dailyn/a 39629.291,282 EUR-1,108

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

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

DEFPARAM CumulateOrders = false

ea = ExponentialAverage[5](close)
eb = ExponentialAverage[20](close)
ec = ExponentialAverage[50](close)
ed = ExponentialAverage[90](close)
ee = ExponentialAverage[140](close)
ef = ExponentialAverage[200](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

EMA
Longer historyRe-run on up to 1,000,000 barsUSD/JPY · Daily · older data 0.00 USD

USD/JPY had no history beyond the standard run, so both runs used 12,000 bars.

USD/JPY · Daily

Bars available12,000
Net, standard 200,000-bar run2,106,160.00 USD
Net, long run2,106,160.00 USD
Net on the older data alone0.00 USD
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 EMA Stack Crossover Bias 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 11 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.75 over 304 trades.

How large was the drawdown?

The best run had a maximum drawdown of 396,900 USD at the tested position size, against a net result of 2,106,160 USD.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

Three Bar Slope Short Crossover

Also a trend strategy.

1.75 PF · 267 trades

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

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