Join waitlist
Strategies / Momentum / Bidirectional MACD Zero Line Cross

Bidirectional MACD Zero Line Cross

The strategy goes long when a 13 and 19 period MACD line crosses above zero. It goes short when an 11 and 20 period MACD line crosses below zero, with a 21% stop and 20% target.

MomentumLong & shortSwingUSD/JPYDaily
1.48Profit factor
2,884,240Net profit USD
35.00%Win rate
480Trades
-600,670Max drawdown
6,009Avg trade

Best run of 9. USD/JPY, Daily, spread 1, from run pf:2026-10-11-USDJPY-D.tsv:6.

Entry rules, long

  1. The position is not already long.

Entry rules, short

  1. No long entry is made on the same bar.

Exit rules

  1. Long trades have no stop loss or profit target and are closed by an opposite signal.
  2. Short trades close at a 21% stop loss or a 20% profit target.

Test conditions

PeriodUp to 2026-10-11
InstrumentUSD/JPY, Daily
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-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.48 48035.002,884,240 USD-600,670
USD/JPY1 hourn/a 5,02532.10825,300 USD-321,910
EUR/USDDailyn/a 43739.13158,843 USD-43,645
Nikkei 225Dailyn/a 41233.2550,852 USD-16,245
Nasdaq 100Dailyn/a 40931.3013,405 EUR-7,227
Gold4 hoursn/a 1,10334.183,593 EUR-1,143
GoldDailyn/a 51932.952,789 EUR-998
Gold1 hourn/a 4,34330.852,332 EUR-1,165
S&P 500Dailyn/a 55130.131,455 EUR-1,276

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Bidirectional MACD Zero Line Cross
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

macdlong = ExponentialAverage[13](close) - ExponentialAverage[19](close)
macdshort = ExponentialAverage[11](close) - ExponentialAverage[20](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

MACDEMA
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 Bidirectional MACD Zero Line 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 9 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.48 over 480 trades.

How large was the drawdown?

The best run had a maximum drawdown of 600,670 USD at the tested position size, against a net result of 2,884,240 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

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

MACD Zero Line Downside Crossover

Also a momentum strategy.

1.47 PF · 203 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