Join waitlist
Strategies / Trend / MACD Zero Cross and EMA Stack

MACD Zero Cross and EMA Stack

Buys on a MACD zero-line cross, or when four EMAs stack in rising order with clear gaps between them. Exits on a MACD signal-line cross down, or at a 10% stop-loss or 20% profit target.

TrendLong onlySwingNasdaq 100Daily
2.25Profit factor
12,308Net profit EUR
47.06%Win rate
187Trades
-1,750Max drawdown
65.82Avg trade

Best run of 20. Nasdaq 100, Daily, spread 3, from run pf:2026-10-10-NAS100-D.tsv:4.

Entry rules, long

  1. Trigger two: the 20, 50, 100 and 200-period EMAs newly stack in order, each gap between them exceeding 0.2% of the close.
  2. No long position is open.

Exit rules

  1. A stop-loss sits 10% below the entry price.
  2. A profit target sits 20% above the entry price.

Test conditions

PeriodUp to 2026-10-10
InstrumentNasdaq 100, Daily
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-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Nasdaq 100Best runDaily2.25 18747.0612,308 EUR-1,750
EUR/USD2 min2.24 3,49727.60429,030 USD-43,519
Dow JonesDaily1.91 24650.8117,935 EUR-3,184
DAX 40Daily1.83 24543.6711,665 EUR-2,130
USD/JPYDailyn/a 22843.86595,140 USD-430,900
EUR/USD3 minn/a 3,53030.14366,581 USD-119,804
USD/JPY1 hourn/a 2,43440.71364,800 USD-168,380
EUR/USD5 minn/a 3,48031.47210,809 USD-81,629
EUR/USDDailyn/a 21644.9170,949 USD-22,422
EUR/USD1 hourn/a 3,13839.6746,100 USD-29,590
Nikkei 225Dailyn/a 19647.4517,271 USD-8,357
Dow Jones4 hoursn/a 19745.1811,867 EUR-3,842
Nasdaq 1004 hoursn/a 60245.519,302 EUR-3,551
Nasdaq 1001 hourn/a 2,24140.707,027 EUR-3,784
DAX 404 hoursn/a 59044.414,221 EUR-3,753
US Crude Oil4 hoursn/a 41343.103,794 EUR-3,483
S&P 5004 hoursn/a 60048.332,246 EUR-808
S&P 500Dailyn/a 25545.101,638 EUR-596
Gold4 hoursn/a 54845.261,609 EUR-442
GoldDailyn/a 23936.40777 EUR-653

Charts

Results by run

Top 10 of 20 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

// ==============================================================
// MACD Zero Cross and EMA Stack
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close)
signal = ExponentialAverage[9](myMacd)

emaa = ExponentialAverage[20](close)
emab = ExponentialAverage[50](close)
emac = ExponentialAverage[100](close)
emad = ExponentialAverage[200](close)
mindiff = close * 0.2 / 100

20 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
Longer historyRe-run on up to 1,000,000 barsNasdaq 100 · Daily · older data 0.00 EUR

Nasdaq 100 had no history beyond the standard run, so both runs used 10,000 bars.

Nasdaq 100 · Daily

Bars available10,000
Net, standard 200,000-bar run12,307.90 EUR
Net, long run12,307.90 EUR
Net on the older data alone0.00 EUR
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 MACD Zero Cross and EMA Stack 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 20 market and timeframe combinations. The best run was Nasdaq 100, Daily, with a profit factor of 2.25 over 187 trades.

How large was the drawdown?

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

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

Volatility Spike Regression Long

Best run on the same market, Nasdaq 100.

1.22 PF · 1,850 trades

Supertrend Direction Flip Long

Also a trend strategy.

2.25 PF · 188 trades

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

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