Join waitlist
Strategies / Momentum / Log MACD Histogram Zero Cross

Log MACD Histogram Zero Cross

The strategy buys when the histogram of a logarithmic MACD crosses above zero and sells when it crosses back below zero. It trades only long, using the log ratio of fast and slow averages rather than raw price differences.

MomentumLong onlySwingUSD/JPY1 hour
n/aProfit factor
406,600Net profit USD
35.89%Win rate
5,402Trades
-337,090Max drawdown
75.27Avg trade

Best run of 16. USD/JPY, 1 hour, spread 1, from run sweeps:2026-10-11-USDJPY-1h-opt.tsv:5.

Entry rules, long

  1. The histogram is the log MACD (12 and 26 period EMAs) minus its 9-period EMA signal line.

Exit rules

  1. The histogram crosses below zero and the long is closed.

Test conditions

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

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run1 hourn/a 5,40235.89406,600 USD-337,090
USD/JPY4 hoursn/a 1,36839.40626,830 USD-228,870
Nikkei 225Dailyn/a 44340.6332,780 USD-9,130
Nikkei 2254 hoursn/a 1,00337.3930,828 USD-10,395
Dow JonesDailyn/a 59041.8620,131 EUR-6,660
DAX 40Dailyn/a 63440.2212,698 EUR-4,007
DAX 401 hourn/a 4,28437.5412,265 EUR-3,430
Nasdaq 1004 hoursn/a 1,26838.4111,808 EUR-4,623
DAX 404 hoursn/a 1,22038.9311,547 EUR-3,254
Nasdaq 100Dailyn/a 47238.358,004 EUR-5,494
Nasdaq 1001 hourn/a 4,68535.626,706 EUR-6,254
GoldDailyn/a 54337.202,773 EUR-1,424
Gold4 hoursn/a 1,23738.722,408 EUR-865
S&P 500Dailyn/a 60439.072,134 EUR-961
S&P 5004 hoursn/a 1,27238.841,676 EUR-1,102
Gold1 hourn/a 4,66334.531,566 EUR-1,081

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

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

DEFPARAM CumulateOrders = false

fast = ExponentialAverage[12](close)
slow = ExponentialAverage[26](close)
lmacd = LOG(fast) - LOG(slow)
signal = ExponentialAverage[9](lmacd)
hist = lmacd - signal

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 weaknesses3 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 337,090 USD is large next to the net profit of 406,600 USD.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run Log 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 16 market and timeframe combinations. The best run by trade count was USD/JPY, 1 hour, with 5,402 trades.

How large was the drawdown?

The best run had a maximum drawdown of 337,090 USD at the tested position size, against a net result of 406,600 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

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

ATR Momentum

Also a momentum strategy.

n/a PF · 15,021 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

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