Join waitlist
Strategies / Pattern / Regular MACD Divergence Trend

Regular MACD Divergence Trend

Buys on a regular bullish MACD divergence while the 150-period EMA is above the 600-period EMA. Sells short on the mirrored bearish divergence, with stops at the 10-bar extreme and targets at 1.5 times the stop distance.

PatternLong & shortSwingGold1 hour
n/aProfit factor
1,059Net profit EUR
42.47%Win rate
511Trades
-395Max drawdown
2.07Avg trade

Best run of 9. Gold, 1 hour, spread 0.6, from run sweeps:2026-10-04-GOLD-1h-opt.tsv:34.

Entry rules, long

  1. That MACD value is higher than the previous pivot's, while its low price is lower, with pivots 5 to 60 bars apart
  2. The 150-period EMA is above the 600-period EMA

Entry rules, short

  1. That MACD value is lower than the previous pivot's, while its high price is higher, with pivots 5 to 60 bars apart
  2. The 150-period EMA is below the 600-period EMA

Exit rules

  1. A stop at the lowest low of the last 10 bars for longs, or the highest high for shorts, set when the position opens
  2. A profit target at 1.5 times the stop distance from entry

Test conditions

PeriodUp to 2026-10-04
InstrumentGold, 1 hour
Spread0.6 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-04

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
GoldBest run1 hourn/a 51142.471,059 EUR-395
Dow Jones4 hoursn/a 4748.949,926 EUR-2,819
Nikkei 225Dailyn/a 3357.588,847 USD-3,832
Nikkei 2254 hoursn/a 10339.816,850 USD-6,295
Dow JonesDailyn/a 4942.866,085 EUR-2,585
US Crude Oil1 hourn/a 35843.583,790 EUR-2,294
Nasdaq 1004 hoursn/a 11337.173,305 EUR-1,697
US Crude Oil4 hoursn/a 10837.961,910 EUR-1,328
Gold4 hoursn/a 12643.65401 EUR-159

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Regular MACD Divergence Trend
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Pattern
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE lastplosc = 0
ONCE lastpllow = 0
ONCE lastplbar = -1
ONCE lastphosc = 0
ONCE lastphhigh = 0
ONCE lastphbar = -1
ONCE slbuy = 0
ONCE slsell = 0

osc = ExponentialAverage[12](close) - ExponentialAverage[26](close)
emaa = ExponentialAverage[150](close)
emab = ExponentialAverage[600](close)

64 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
  • No profit factor is available, because only sweep results exist for this strategy.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Regular MACD Divergence Trend 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 9 market and timeframe combinations. The best run by trade count was Gold, 1 hour, with 511 trades.

How large was the drawdown?

The best run had a maximum drawdown of 395 EUR at the tested position size, against a net result of 1,058 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

CCI Breakout

Best run on the same market, Gold.

1.08 PF · 6,065 trades

Breakout Reversal

Also a pattern strategy.

n/a PF · 459 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