Join waitlist
Strategies / Trend / Zero Cross Or EMA Stack Long

Zero Cross Or EMA Stack Long

Buys when MACD crosses above 0, or when the 20, 50, 100 and 200 period EMAs stack upward. Closes when MACD crosses under its signal line, with a 10% stop loss and 20% profit target.

TrendLong onlyIntradayEUR/USD3 min
2.21Profit factor
1,746,340Net profit USD
37.57%Win rate
5,651Trades
-114,701Max drawdown
309Avg trade

Best run of 21. EUR/USD, 3 min, spread 1, from run pf:2026-10-12-EURUSD-3m.tsv:7.

Entry rules, long

  1. Or the 20, 50, 100 and 200 period EMAs stack upward, each gap wider than 0.0008% of close.

Exit rules

  1. A 10% stop loss from entry closes the trade.
  2. A 20% profit target from entry closes the trade.

Test conditions

PeriodUp to 2026-10-12
InstrumentEUR/USD, 3 minutes
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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
EUR/USDBest run3 min2.21 5,65137.571,746,340 USD-114,701
S&P 500Daily1.78 53158.195,738 EUR-851
Nasdaq 100Daily1.72 43554.9421,506 EUR-3,806
EUR/USD5 min1.62 5,57438.03849,500 USD-95,938
DAX 40Daily1.46 52454.0118,417 EUR-3,794
Dow JonesDaily1.44 51258.0128,852 EUR-6,652
Dow Jones4 hours1.44 32056.5621,849 EUR-4,681
Nasdaq 1004 hours1.29 1,05756.0116,152 EUR-3,847
S&P 5004 hours1.24 1,03755.643,301 EUR-765
EUR/USD2 minn/a 5,56133.03825,552 USD-108,928
USD/JPY4 hoursn/a 97549.64506,930 USD-448,760
EUR/USD10 minn/a 5,34539.76377,259 USD-114,194
EUR/USD15 minn/a 5,31439.80294,592 USD-86,675
EUR/USD1 hourn/a 4,69445.10153,700 USD-71,386
EUR/USD30 minn/a 5,13843.15146,064 USD-107,027
EUR/USDDailyn/a 34752.4594,168 USD-29,263
Nikkei 225Dailyn/a 35356.0948,306 USD-13,662
Nikkei 2254 hoursn/a 78051.0317,795 USD-12,557
DAX 404 hoursn/a 95653.1410,082 EUR-6,533
Gold4 hoursn/a 89951.722,683 EUR-1,281
GoldDailyn/a 43445.392,431 EUR-1,294

Charts

Results by run

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

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// Zero Cross Or EMA Stack Long
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 3 minutes
// ==============================================================

DEFPARAM CumulateOrders = false

myMacd = MACDLine[12,26,9](close)
signal = ExponentialAverage[9](myMacd)
emaa = ExponentialAverage[20](close)
emab = ExponentialAverage[50](close)
emac = ExponentialAverage[100](close)
emad = ExponentialAverage[200](close)
mindiff = close * 0.0008 / 100

15 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

MACDEMA
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run Zero Cross Or EMA Stack 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 21 market and timeframe combinations. The best run was EUR/USD, 3 minutes, with a profit factor of 2.21 over 5,651 trades.

How large was the drawdown?

The best run had a maximum drawdown of 114,701 USD at the tested position size, against a net result of 1,746,340 USD.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Slow MACD Slope

Uses the same indicator.

6.80 PF · 7,305 trades

Stochastic Crossover Long With Bracket

Best run on the same market, EUR/USD.

1.75 PF · 5,666 trades

Moving Average Crossover Long

Also a trend strategy.

2.21 PF · 199 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

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