Join today
Strategies / Trend / MACD Signal Cross

MACD Signal Cross Backtest

This is the textbook MACD signal: buy when the MACD(12, 26, 9) line crosses above its signal line, sell short on the cross below. Positions close when the lines point the other way or at a 1% stop. In our tests it mostly lost money.

TrendLong & shortIntradayDAX 405 min
n/aProfit factor
-29,036Net profit EUR
28.10%Win rate
8,088Trades
-29,225Max drawdown
-3.59Avg trade

Best run of 17. DAX 40, 5 min, spread 3, from run sweeps:2026-09-07-DAX40-5m-opt.tsv:11.

Entry rules, long

  1. Members only
  2. No position is open

Entry rules, short

  1. Members only
  2. No position is open

Exit rules

  1. Stop loss at 1% from entry
  2. Members only
  3. Close a short when the MACD line is above the signal line

Test conditions

PeriodUp to 2026-09-07
InstrumentDAX 40, 5 minutes
Spread3 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-08

Parameters

positionSize
Contracts per trade
1
macdFast
MACD fast EMA length
12
macdSlow
MACD slow EMA length
26
macdSignalPeriod
MACD signal line length
9
stopLossPct
Protective stop, percent of entry price
1

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
DAX 40Best run5 minn/a 8,08828.10-29,036 EUR-29,225
S&P 5004 hoursn/a 1,46632.951,625 EUR-1,222
DAX 401 hourn/a 4,57734.30626 EUR-8,984
Gold1 hourn/a 4,84532.07-675 EUR-2,269
Gold30 minn/a 7,77431.79-2,127 EUR-4,636
S&P 50030 minn/a 7,54332.43-3,922 EUR-6,581
Gold5 minn/a 7,92628.50-5,364 EUR-5,743
Gold15 minn/a 7,81029.54-5,724 EUR-6,028
S&P 50015 minn/a 7,60931.06-5,934 EUR-6,007
S&P 5001 hourn/a 5,03730.85-6,508 EUR-6,917
S&P 5005 minn/a 7,96528.06-8,301 EUR-8,317
Nasdaq 1001 hourn/a 5,10831.34-11,045 EUR-11,629
Nasdaq 10015 minn/a 7,48232.58-16,254 EUR-18,183
Nasdaq 10030 minn/a 7,61031.27-16,604 EUR-16,782
DAX 4030 minn/a 7,69732.58-18,070 EUR-19,902
Nasdaq 1005 minn/a 7,86130.73-22,076 EUR-22,223
DAX 4015 minn/a 7,80831.71-24,690 EUR-24,944

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-25K-13K1K2KS&P 500 · 4 hoursDAX 40 · 1 hourGold · 1 hourGold · 30 minS&P 500 · 30 minGold · 5 minGold · 15 minS&P 500 · 15 minS&P 500 · 1 hourS&P 500 · 5 minNasdaq 100 · 1 hourNasdaq 100 · 15 minNasdaq 100 · 30 minDAX 40 · 30 minNasdaq 100 · 5 minDAX 40 · 15 min

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 Signal Cross
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: 5 minutes
// ============================================================

// --- 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
stopLossPct = 1           // protective stop, percent of entry price

// --- Indicators ---
// Names differ from MACDLine / MACDSignal because ProBuilder ignores case.
macdMain = MACDLine[macdFast, macdSlow, macdSignalPeriod](close)
macdTrigger = MACDSignal[macdFast, macdSlow, macdSignalPeriod](close)

25 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • The main run lost money. DAX 40 5 minutes finished at -29,036.1 EUR over 8088 trades, with a drawdown of 29,225.3 EUR.
  • Only two market tests were profitable (S&P 500 4 hours and DAX 40 1 hour), and both gains were small.
  • The win rate was 28.1% on DAX 40 5 minutes, and the average trade of -3.59 EUR did not cover costs.
  • Profit factor was not recorded. All rows come from parameter sweeps.

Indicators used

MACD

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

Should I run this in ProOrder?

It can be loaded into ProOrder, but the backtests on this page do not support trading it as it stands. Treat it as a baseline to improve.

Did it work on any market?

S&P 500 4 hours made 1,624.76 EUR and DAX 40 1 hour made 626 EUR. Every other row lost, with the worst at -24,689.5 EUR on DAX 40 15 minutes.

What drawdown did it have at 1 contract?

On DAX 40 5 minutes the drawdown was 29,225.3 EUR at 1 contract, about the size of the full loss.

Why test it on short timeframes?

MACD crosses are popular with intraday traders. The results suggest the signal fires too often on 5 to 30 minute charts and costs pile up.

Related

Strategies like this one

Slow MACD Slope

Uses the same indicator.

6.80 PF · 7,305 trades

Buy After Price Fall

Best run on the same market, DAX 40.

1.88 PF · 312 trades

Long-Term Moving Average Cross

Also a trend strategy.

12.31 PF · 61 trades

Want systems with better numbers than this one? 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