Join waitlist
Strategies / Momentum / MACD Histogram Cross Filter

MACD Histogram Cross Filter

The strategy buys when the MACD histogram crosses above zero while price is at or above a 50-period EMA, and sells short on the mirror condition. Each position closes when the histogram starts moving against it, and an opposite signal reverses it.

MomentumLong & shortSwingDAX 404 hours
1.28Profit factor
11,155Net profit EUR
41.05%Win rate
1,301Trades
-1,676Max drawdown
8.57Avg trade

Best run of 8. DAX 40, 4 hours, spread 3, from run pf:2026-10-12-DAX40-4h.tsv:1.

Entry rules, long

  1. The close is at or above the 50-period EMA.

Entry rules, short

  1. The close is at or below the 50-period EMA.

Exit rules

  1. A short closes when the histogram is higher than on the previous bar, unless a long signal fires.

Test conditions

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

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
DAX 40Best run4 hours1.28 1,30141.0511,155 EUR-1,676
USD/JPY4 hours1.23 1,44140.32532,240 USD-107,840
EUR/USD4 hoursn/a 1,82637.2420,631 USD-11,752
SilverDailyn/a 53033.7712,842 USD-5,192
Nikkei 2254 hoursn/a 1,04136.706,824 USD-5,469
DAX 40Dailyn/a 65640.405,019 EUR-3,518
Gold4 hoursn/a 1,27036.14769 EUR-721
GoldDailyn/a 57139.23585 EUR-250

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

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

DEFPARAM CumulateOrders = false

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

17 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 Cross Filter 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 8 market and timeframe combinations. The best run was DAX 40, 4 hours, with a profit factor of 1.28 over 1,301 trades.

How large was the drawdown?

The best run had a maximum drawdown of 1,676 EUR at the tested position size, against a net result of 11,155 EUR.

Does it trade long, short or both?

It trades both long and short.

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

WaveTrend Average Momentum Long

Also a momentum strategy.

1.27 PF · 2,902 trades

Want strategies that are already part of a live portfolio? Join the ProRealAlgos waitlist.

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