Join today
Strategies / Trend / MACD Zero Cross

MACD Zero Cross: a simple momentum flip system

This strategy buys when the MACD(12, 26, 9) value crosses above zero and sells short when it crosses below. A weak ADX(14) filter above 5 is the only other condition. Trades exit at a 70 point target, a 60 point stop or on the opposite signal.

TrendLong & shortSwingUSD/JPY4 hours
1.14Profit factor
882,830Net profit JPY
42.55%Win rate
2,724Trades
-117,945Max drawdown
324Avg trade

Best run of 3. USD/JPY, 4 hours, spread 1, from run pf:2026-09-24-USDJPY-4h.tsv:1.

Entry rules, long

  1. Members only
  2. ADX(14) is above 5

Entry rules, short

  1. Members only
  2. ADX(14) is above 5

Exit rules

  1. Members only
  2. Stop loss of 60 points
  3. An opposite signal reverses the position

Test conditions

PeriodUp to 2026-09-24
InstrumentUSD/JPY, 4 hours
Spread1 points
Contracts1
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-09-24

Parameters

positionSize
Contracts per trade
1
macdFast
MACD fast EMA length
12
macdSlow
MACD slow EMA length
26
macdSignalPeriod
MACD signal line length
9
adxPeriod
ADX length
14
adxThreshold
Minimum ADX reading to trade
5
takeProfitPoints
Target in points
70
stopLossPoints
Protective stop in points
60

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run4 hours1.14 2,72442.55882,830 JPY-117,945
SilverDailyn/a 1,01438.8612,142 USD-7,446
GoldDailyn/a 1,09736.191,349 EUR-737

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-200K-100K500K1.0MUSD/JPY · 4 hoursSilver · DailyGold · Daily

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

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

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
positionSize = 1          // contracts per trade
macdFast = 12             // MACD fast EMA length
macdSlow = 26             // MACD slow EMA length
macdSignalPeriod = 9      // MACD signal line length
adxPeriod = 14            // ADX length
adxThreshold = 5          // minimum ADX reading to trade
takeProfitPoints = 70     // target in points
stopLossPoints = 60       // protective stop in points

// --- Indicators ---
macdValue = MACD[macdFast, macdSlow, macdSignalPeriod](close)
adxValue = ADX[adxPeriod]

17 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • The best run had a profit factor of 1.14, so gains were only slightly larger than losses and extra costs could erase them.
  • Win rate on that run was 42.55% with a target only a little wider than the stop, which leaves a thin margin.
  • Only three markets appear on this page (USD/JPY, Silver and Gold), so it has a narrow test base.
  • The ADX filter at 5 blocks almost nothing, so sideways markets can produce many whipsaw trades.

Indicators used

MACDADX

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Can MACD Zero Cross run live in ProOrder?

Yes, it uses a standard MACD, ADX and a fixed stop and target. It still needs a compile check after the rewrite.

Where was it tested?

USD/JPY 4 hours gave the best result with JPY 882,830 from 2,724 trades. Silver Daily made USD 12,142 and Gold Daily EUR 1,348.9.

What drawdown comes with 1 contract?

Max drawdown on USD/JPY 4 hours was JPY 117,945. On Gold Daily it was EUR 737, so drawdown depends heavily on the instrument's contract value.

Why a 4 hour chart?

MACD zero crosses are slow signals. On 4 hour bars the 70 point target and 60 point stop fit the typical move size better than on very short bars.

Related

Strategies like this one

Slow MACD Slope

Uses the same indicator.

6.80 PF · 7,305 trades

Supertrend Counter Trend

Best run on the same market, USD/JPY.

3.47 PF · 1,444 trades

SMA Cross 10/30

A similar profit factor.

1.14 PF · 2,495 trades

Talk through MACD systems with other ProRealTime traders. The ProRealAlgos waitlist is open.

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