Join waitlist
Strategies / Momentum / MACD Histogram Zero Cross

MACD Histogram Zero Cross

The strategy buys 1 contract when the MACD histogram crosses above zero and closes the long when it crosses below zero. The MACD uses 3 and 7 period exponential averages with a 5 period signal line.

MomentumLong onlySwingDAX 404 hours
1.15Profit factor
19,243Net profit EUR
40.10%Win rate
3,292Trades
-4,031Max drawdown
5.85Avg trade

Best run of 7. DAX 40, 4 hours, spread 3, from run pf:2026-10-13-DAX40-4h.tsv:6.

Entry rules, long

  1. The MACD line is the 3 period EMA minus the 7 period EMA, and the signal is the 5 period EMA of that line.
  2. Signals are evaluated only after bar 20.

Exit rules

  1. The histogram crosses under 0 while a long position is open, closing the trade by selling 1 contract at market.

Test conditions

PeriodUp to 2026-10-13
InstrumentDAX 40, 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-13

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
DAX 40Best run4 hours1.15 3,29240.1019,243 EUR-4,031
Nikkei 2254 hoursn/a 2,78337.3715,649 USD-11,563
Dow Jones4 hoursn/a 1,14940.3010,877 EUR-9,676
Nasdaq 1004 hoursn/a 3,47238.289,586 EUR-4,305
DAX 40Dailyn/a 1,67639.746,229 EUR-5,281
Gold4 hoursn/a 3,47937.602,498 EUR-980
S&P 500Dailyn/a 1,71938.341,554 EUR-1,322

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// MACD Histogram Zero Cross
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long only
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

line = ExponentialAverage[3](close) - ExponentialAverage[7](close)
signal = ExponentialAverage[5](line)
hist = line - signal

9 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
  • A profit factor of 1.15 leaves little room for costs beyond the spread.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run MACD Histogram Zero Cross 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 7 market and timeframe combinations. The best run was DAX 40, 4 hours, with a profit factor of 1.15 over 3,292 trades.

How large was the drawdown?

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

Heikin Ashi Color Flip

Best run on the same market, DAX 40.

1.12 PF · 3,692 trades

MACD Signal Line Crossover

Also a momentum strategy.

1.16 PF · 1,222 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