Join waitlist
Strategies / Momentum / MACD Histogram Trend Cross

MACD Histogram Trend Cross

Buys when the close is above the 200-period average and the MACD histogram turns positive, and sells short in the opposite case. Each trade has a stop and a target set from the 14-period average true range.

MomentumLong & shortSwingSilver4 hours
2.27Profit factor
172,397Net profit USD
39.02%Win rate
1,061Trades
-30,758Max drawdown
162Avg trade

Best run of 5. Silver, 4 hours, spread 2, from run pf:2026-10-05-SILVER-4h.tsv:2.

Entry rules, long

  1. The close is above the 200-period exponential moving average

Entry rules, short

  1. The close is below the 200-period exponential moving average

Exit rules

  1. A stop loss sits 1.5 times the 14-period average true range from the entry price
  2. A profit target sits 1.5 times the stop distance from the entry price

Test conditions

PeriodUp to 2026-10-05
InstrumentSilver, 4 hours
Spread2 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-05

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
SilverBest run4 hours2.27 1,06139.02172,397 USD-30,758
Nikkei 225Dailyn/a 37745.8923,492 USD-17,881
Brent Crude4 hoursn/a 61742.636,941 EUR-3,357
Gold4 hoursn/a 1,07842.121,373 EUR-501
S&P 500Dailyn/a 52538.48983 EUR-662

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

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

DEFPARAM CumulateOrders = false

ema = ExponentialAverage[200](close)
myMacd = ExponentialAverage[12](close) - ExponentialAverage[26](close)
signal = ExponentialAverage[9](myMacd)
hist = myMacd - signal
myAtr = Average[14](TR(close))

18 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

True RangeMACDEMA
Read this firstKnown weaknesses2 points
  • Results include the spread only. Commissions and overnight financing are not included.
  • The code is published as it was backtested and has not been compiled again since.

Questions

About this strategy

Can I run MACD Histogram Trend 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 5 market and timeframe combinations. The best run was Silver, 4 hours, with a profit factor of 2.27 over 1,061 trades.

How large was the drawdown?

The best run had a maximum drawdown of 30,758 USD at the tested position size, against a net result of 172,396 USD.

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

SMA Crossover With RSI Exit

Best run on the same market, Silver.

2.13 PF · 8,999 trades

Range Oscillator Stochastic Confirmation

Also a momentum strategy.

2.28 PF · 174 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