Join waitlist
Strategies / Trend / MACD Histogram Zero Trend Filter

MACD Histogram Zero Trend Filter

The strategy buys when the MACD histogram crosses above zero while the MACD line is negative and price sits well above a 200 period EMA. It sells when the high or low falls below short and long period EMAs.

TrendLong onlyIntradayEUR/USD3 min
n/aProfit factor
99,634Net profit USD
50.00%Win rate
18Trades
-82,278Max drawdown
5,535Avg trade

Best run of 4. EUR/USD, 3 min, spread 1, from run sweeps:2026-10-12-EURUSD-3m-opt.tsv:6.

Entry rules, long

  1. The MACD line is below zero.
  2. The close is above 1.1 times the 200 period EMA.
  3. No position is open.

Exit rules

  1. The high falls below the 8 period EMA, or the low falls below the 100 period EMA, closing the long.

Test conditions

PeriodUp to 2026-10-12
InstrumentEUR/USD, 3 minutes
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-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
EUR/USDBest run3 minn/a 1850.0099,634 USD-82,278
EUR/USD5 minn/a 1060.0078,166 USD-27,360
US Crude Oil4 hoursn/a 475.00556 EUR-248
FTSE 100Dailyn/a 1100.00154 EUR-68.60

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// MACD Histogram Zero Trend Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long only
// Timeframe tested: 3 minutes
// ==============================================================

DEFPARAM CumulateOrders = false

myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close)
sig = ExponentialAverage[9](myMacd)
delta = myMacd - sig
ematrend = ExponentialAverage[200](close)
emafast = ExponentialAverage[8](close)
emamid = ExponentialAverage[100](close)

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 weaknesses4 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The best run has only 18 trades, which is a small sample to judge it on.
  • The maximum drawdown of 82,278 USD is large next to the net profit of 99,634 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 MACD Histogram Zero Trend 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 4 market and timeframe combinations. The best run by trade count was EUR/USD, 3 minutes, with 18 trades.

How large was the drawdown?

The best run had a maximum drawdown of 82,278 USD at the tested position size, against a net result of 99,634 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

Stochastic Crossover Long With Bracket

Best run on the same market, EUR/USD.

1.75 PF · 5,666 trades

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

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