Join waitlist
Strategies / Momentum / MACD Histogram Zero Line Long

MACD Histogram Zero Line Long

The strategy buys when the MACD histogram crosses above zero, using 20 and 40 period EMAs and a 4 period signal. It closes the long when the histogram crosses below zero.

MomentumLong onlySwingDow JonesDaily
1.39Profit factor
23,453Net profit EUR
38.62%Win rate
637Trades
-4,479Max drawdown
36.82Avg trade

Best run of 15. Dow Jones, Daily, spread 3, from run pf:2026-10-12-DOW30-D.tsv:18.

Entry rules, long

  1. No long position is open.

Exit rules

  1. The histogram crosses below zero, closing the long position.

Test conditions

PeriodUp to 2026-10-12
InstrumentDow Jones, 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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
Dow JonesBest runDaily1.39 63738.6223,453 EUR-4,479
DAX 40Daily1.34 65639.0214,088 EUR-3,457
USD/JPY1 hourn/a 5,79632.64531,790 USD-315,140
Nikkei 225Dailyn/a 48935.3832,701 USD-12,942
SilverDailyn/a 52032.5032,018 USD-27,668
Nikkei 2254 hoursn/a 1,07335.4131,580 USD-10,573
Silver4 hoursn/a 1,27032.6830,715 USD-14,508
DAX 404 hoursn/a 1,26837.3013,554 EUR-3,765
DAX 401 hourn/a 4,51633.7210,550 EUR-4,858
Nasdaq 100Dailyn/a 50136.3310,383 EUR-4,528
Nasdaq 1004 hoursn/a 1,37135.817,416 EUR-4,229
GoldDailyn/a 56635.872,802 EUR-1,352
Gold4 hoursn/a 1,30635.302,688 EUR-1,026
S&P 500Dailyn/a 67934.902,369 EUR-901
Gold1 hourn/a 4,96131.491,477 EUR-1,254

Charts

Results by run

Top 10 of 15 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 Histogram Zero Line Long
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

myMacd = ExponentialAverage[20](close) - ExponentialAverage[40](close)
amacd = ExponentialAverage[4](myMacd)
delta = myMacd - amacd

10 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
  • 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 MACD Histogram Zero Line 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 15 market and timeframe combinations. The best run was Dow Jones, Daily, with a profit factor of 1.39 over 637 trades.

How large was the drawdown?

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

Turtle Trade

Best run on the same market, Dow Jones.

2.42 PF · 6,324 trades

RSI Moving Average Crossover Filter

Also a momentum strategy.

1.38 PF · 794 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