Join waitlist
Strategies / Momentum / MACD Zero Line Two-Way Crossover

MACD Zero Line Two-Way Crossover

Buys when the MACD line, set to 12, 26 and 9, crosses above zero and sells short when it crosses below. Each opposite crossover closes the open trade and reverses the position.

MomentumLong & shortSwingEUR/USDDaily
1.51Profit factor
17,048Net profit USD
35.56%Win rate
405Trades
-4,314Max drawdown
42.09Avg trade

Best run of 4. EUR/USD, Daily, spread 1.2, from run pf:2026-10-10-EURUSD-D.tsv:21.

Entry rules, long

  1. The MACD line (12, 26, 9) crosses over 0.

Entry rules, short

  1. The MACD line (12, 26, 9) crosses under 0.

Exit rules

  1. A cross over 0 closes the short position, and the same cross opens a long position.

Test conditions

PeriodUp to 2026-10-10
InstrumentEUR/USD, Daily
Spread1.2 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-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
EUR/USDBest runDaily1.51 40535.5617,048 USD-4,314
Brent CrudeDaily1.38 16931.3621,712 EUR-15,534
GoldDaily1.27 48129.5220,765 EUR-19,783
GBP/USDDaily1.23 45932.249,436 USD-6,280

Charts

Results by run

Above 1.0 made money, below 1.0 lost money.

The code

ProBuilder code, as tested

// ==============================================================
// MACD Zero Line Two-Way Crossover
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false
ONCE capital = 10000

25 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

MACD
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 Zero Line Two-Way Crossover 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 was EUR/USD, Daily, with a profit factor of 1.51 over 405 trades.

How large was the drawdown?

The best run had a maximum drawdown of 4,314 USD at the tested position size, against a net result of 17,048 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

Stochastic Crossover Long With Bracket

Best run on the same market, EUR/USD.

1.75 PF · 5,666 trades

MACD Histogram Signal Crossover (long only)

Also a momentum strategy.

1.51 PF · 580 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