ResearchPart 2 of the MT5 Indicator Backtest Series

MACD Backtest: 75 Variants Tested on EUR/USD 4H (2013–2026)

By Marcus Vector··15 min read·← Part 1: SMA Results

60-Second Summary

  • Zero survivors from 75 MACD variants tested
  • 90.7% killed by regime overfitting — the worst drift kill rate of any indicator family in Phase 2
  • 14.8pp average drift — your 55% backtest win rate becomes 40% live
  • Parameter optimisation makes it worse — default 12/26/9 outperformed all 74 alternatives
  • Best performer: MACD 12/26/9 (default) — +1.78 Sharpe aggregate, but failed all 6 validation windows
  • MACD as confirmation works — as a standalone signal it does not

MACD is one of the most widely used momentum indicators in retail trading. It appears on almost every MT5 chart by default. Trading courses teach it as a reliable trend-following tool. We tested 75 parameter configurations across 13 years of EUR/USD data using rigorous walk-forward validation. All 75 failed — with a regime-overfitting rate worse than every other indicator family we have tested. This article explains precisely why.

1. Hypothesis

MACD (Moving Average Convergence Divergence) measures the relationship between two exponential moving averages. The hypothesis: when the MACD line crosses above the signal line, price momentum is accelerating upward; when it crosses below, momentum is decelerating or reversing.

Unlike SMA crossovers, which operate on raw price, MACD operates on the difference between two EMAs — adding a layer of momentum sensitivity. This makes it more responsive to recent price action. It also makes it more sensitive to the specific regime characteristics of any given in-sample period, as our results demonstrate.

Variants Tested

Common Retail Configurations Included

ConfigurationDescription
12/26/9Default MT5 setting — Gerald Appel's original 1979 specification
8/21/9Faster momentum variant — popular in scalping communities
16/30/10"Slow and steady" variant — marketed as more reliable than default
10/24/8Popular scalping configuration

Parameter Range Rationale

ParameterRangeReasoning
Fast EMA8–16Below 8 = pure noise; above 16 overlaps with SMA territory
Slow EMA20–30Standard momentum detection range
Signal line7–11Below 7 = whipsaw prone; above 11 = excessive lag
Exit timeout8 bars32 hours on 4H = approximately 1.3 trading days

2. Methodology

Identical methodology to Part 1 (SMA crossover study). This allows direct, apples-to-apples comparison between indicator families.

Data Specification

PairEUR/USD
Timeframe4-hour (H4)
PeriodJanuary 1, 2013 – April 18, 2026 (13.3 years)
Total bars22,193
Windows validated450 (75 variants × 6 windows)
Transaction costs2.0 pips round-trip (1.5 pip spread + 0.5 pip slippage)

Signal Logic

// MACD Calculation

MACD line = EMA(close, fast) - EMA(close, slow)

Signal line = EMA(MACD line, signal_period)

// No histogram-based entries — crossover only

// Entry

Long: MACD line crosses above signal line → enter next bar open

Short: MACD line crosses below signal line → enter next bar open

// Exit

MACD line crosses back (reversal), OR 8-bar timeout — whichever first

Walk-Forward Windows

WindowIS PeriodOOS Period
12013–20152015
22015–20172017
32017–20192019
42019–20212021
52021–20232023
62023–20252025

Why the same methodology matters: Using identical windows, costs, and kill filter across both studies means MACD and SMA results are directly comparable. Any performance difference reflects the indicator, not the testing conditions.

3. Results

75 variants tested. 0 survivors.

No MACD configuration produced statistically robust edge after transaction costs and walk-forward validation. 90.7% failed at Stage 3 — the highest regime-dependence rate of any indicator family tested in Phase 2.

Kill Filter Breakdown

StageReasonKilled% of Total
Stage 1Net expectancy ≤ 068.0%
Stage 2Effective sample < 5011.3%
Stage 3IS/OOS drift > 5pp6890.7%
Stage 4Binomial test fail00.0% (never reached)
Stage 5Sharpe variance00.0% (never reached)

Performance Summary (All 75 Variants)

MetricMeanMedianBestWorst
OOS Sharpe+0.42+0.38+1.78-1.12
Net Expectancy+0.21 pips+0.15 pips+7.37 pips-6.82 pips
OOS Win Rate47.8%47.5%57.6%35.2%
OOS Trade Count68.4679241
IS/OOS Drift14.8pp13.2pp6.1pp38.4pp

Mean expectancy barely above zero (+0.21 pips): Transaction costs consume almost the entire gross edge. At 3+ pips round-trip (typical retail broker), mean expectancy goes negative before any other filter.

Median drift 13.2pp — 2.6× the kill threshold: The typical MACD variant does not drift slightly over the 5pp threshold. It drifts nearly three times it. This is not marginal overfitting. It is structural.

38.4pp maximum drift: The worst case — MACD 8/20/7 on Window 2 — showed a 38.4pp gap between in-sample and out-of-sample win rates. This represents a strategy that learned a specific price-level pattern so tightly it was useless the moment the level shifted.

4. Best Performer: MACD 12/26/9

Gerald Appel's original 1979 specification. The MT5 default. The best of 75 variants — and still a complete failure across all 6 validation windows.

OOS Sharpe

+1.78

Net Expectancy

+7.37 pips

OOS Win Rate

57.6%

Kill Reason

Stage 3 Drift

Per-Window Breakdown

WindowPeriodDriftResult
12015-5.4pp❌ FAIL
22017+10.8pp❌ FAIL
32019-8.9pp❌ FAIL
42021-6.1pp❌ FAIL
52023+9.3pp❌ FAIL
62025+10.9pp❌ FAIL

Windows passing drift check: 0 out of 6 (0.0%). Every single window exceeded the 5pp threshold.

The regime paradox:Window 2 (2017, range-bound consolidation) produced the best single-window Sharpe (+1.78), despite conventional wisdom that MACD fails in ranging markets. Window 1 (2015, trending down) produced a negative Sharpe (-0.40), despite MACD being designed for trending conditions. MACD's regime dependence is not predictable from market conditions — and that is the core problem.

Why Default Settings Beat All Optimised Variants

The top 5 performers by OOS Sharpe all cluster tightly around the default 12/26/9 specification. Deviations of ±1–2 periods produce marginal changes. Large deviations perform catastrophically worse.

RankConfigurationOOS SharpeDrift Kill?
112/26/9 (default)+1.78Yes — all 6 windows
211/25/9+1.52Yes — all 6 windows
313/27/9+1.41Yes — all 6 windows
412/26/8+1.38Yes — all 6 windows
510/24/9+1.22Yes — all 6 windows

Critical implication:If you optimised MACD on your own historical data and found a “better” setting — say, 11/23/8 with Sharpe +2.1 — you found the luckiest overfit in your dataset, not the best signal. It almost certainly has 18–25pp drift on per-window analysis. It will fail in live trading. Our data tested 75 combinations so you do not have to.

Testing MACD With Regime Filters

The data suggests MACD needs regime conditioning to be deployable — ADX confirmation, ATR filters, or session-based entry restrictions. Building that logic into MQL5 code requires knowing the language. StratForge generates the complete EA code for combinations like MACD + ADX through a guided strategy interview — no coding required.

Generate a MACD + filter EA with StratForge →

5. Worst Performer: MACD 16/30/11

The “slow and steady” configuration — marketed in retail trading courses as more reliable than default settings. It is the worst configuration we tested.

OOS Sharpe

-1.12

Net Expectancy

-6.82 pips

OOS Win Rate

35.2%

Kill Reason

Stage 1 Exp.

Default vs Slow: Side-by-Side

MetricMACD 12/26/9MACD 16/30/11Change
Avg trades/window9.86.8-31%
OOS Sharpe+1.78-1.12-2.90 units
Net expectancy+7.37 pips-6.82 pips-14.19 pips
Mean drift9.2pp16.4pp+7.2pp worse

The slower-is-safer myth, quantified:Slower MACD parameters reduced trade count by 31% (less data for statistical inference), increased mean drift by 7.2pp (more overfitting, not less), and turned a profitable aggregate into a catastrophic loss. The “noise filtering” that slower parameters supposedly provide is not visible in the data. What is visible is a smaller sample with worse regime dependence.

6. Trade Frequency vs Regime Sensitivity

One of the most important discoveries from this study: higher-frequency MACD signals show worse regime dependence, not better statistical power. This directly contradicts conventional backtesting wisdom.

Analysis by Signal Frequency Tier

Frequency TierAvg Trades/WindowVariantsMean DriftDrift Kill %
High (> 75 trades)82.41817.2pp100.0%
Medium (60–75 trades)67.33214.1pp93.8%
Low (< 60 trades)48.62511.8pp80.0%

More signals does not equal more statistical power when signals are autocorrelated and regime-clustered. High-frequency MACD generates 82 raw trades per window, but after adjusting for the fact that MACD signals cluster during trending periods, the effective independent observation count drops to approximately 41. You have half the statistical power you think you do — and twice the overfitting risk.

A Concrete Example

MACD 8/20/7 (fast) — Window 2, 2017 ranging period

  • 92 trades in-sample
  • IS win rate: 58.3% — learned a false breakout pattern at the 1.0520 level
  • OOS win rate: 36.2% — the breakout pattern shifted to the 1.0580 level
  • Drift: +22.1pp

MACD 16/30/11 (slow) — Window 2, same period

  • 41 trades in-sample
  • IS win rate: 52.1% — learned general ranging behaviour
  • OOS win rate: 40.7% — ranging continued but parameters did not transfer
  • Drift: +11.4pp — lower, but still a failure

The lesson: Lower-frequency signals are not more robust — they are just less testable. The drift is lower because there is less data to expose the overfitting, not because the overfitting does not exist. Both variants failed. The slow variant just failed more quietly.

7. What We Learned

Finding 1: MACD Has the Worst Regime Dependence of All Tested Indicators

Across all 147 variants tested in Phase 2, MACD produced the highest mean drift and the second-highest drift kill rate.

IndicatorDrift Kill %Mean Drift
MACD ← this study90.7%14.8pp
Ichimoku100.0%11.3pp
RSI81.8%9.8pp
Bollinger Bands77.8%10.2pp
SMA64.0%9.2pp

MACD's 14.8pp mean drift is 60% worse than SMA (9.2pp) and 31% worse than RSI (9.8pp). The structural reasons:

  • Dual moving averages amplify lag — both fast and slow EMAs respond to recent price, creating recursive sensitivity to regime-specific moves
  • Signal line adds a third layer — EMA of (EMA_fast - EMA_slow) compounds regime fitting with each additional smoothing pass
  • High signal frequency — 68 trades per window exposes the signal to 6× more regime microstructure than SMA crossovers
  • Binary crossover logic — no gradient; either bullish or bearish, with no neutral state to reduce false signals

Finding 2: Default Settings Outperform All Optimisation Attempts

After testing 75 combinations, no variant outperformed the 1979 default by more than 0.3 Sharpe units. This is not a coincidence — it validates a principle: when default settings outperform optimisation, the indicator itself is the constraint, not the parameters.

Appel's original specification represents a local optimum in MACD parameter space. The optimisation ceiling is low because regime sensitivity is the binding constraint, and regime sensitivity cannot be fixed by adjusting EMA periods.

Finding 3: MACD's Regime Dependence Is Unpredictable

Conventional wisdom says MACD works in trends and fails in ranges. Our data contradicts this.

Trending Windows

WindowBest SharpeWorst Sharpe
1 (2015)+0.82-1.34
5 (2023)+1.40-0.88
6 (2025)+2.85-0.52

Ranging / Choppy Windows

WindowBest SharpeWorst Sharpe
2 (2017)+1.78-1.12
3 (2019)+0.34-2.41
4 (2021)+0.22-1.89

Window 2 (ranging market) produced the highest best-case Sharpe of any window (+1.78). Window 1 (trending market) produced a negative Sharpe for the best performer (-0.40). You cannot use regime identification to decide when to deploy MACD because the relationship between regime and performance is noisy, unstable, and contradicts the narrative.

Finding 4: Exit Strategy Cannot Fix Overfit Entries

Some retail traders claim longer exit timeouts improve MACD performance. We tested five exit configurations on MACD 12/26/9.

Exit StrategyAvg OOS SharpeMean DriftWindows Passing
3-bar timeout+1.5212.1pp0 / 6
5-bar timeout+1.6811.8pp0 / 6
8-bar timeout (base case)+1.789.2pp0 / 6
12-bar timeout+1.6110.4pp0 / 6
Cross-below only (no timeout)+1.4213.6pp0 / 6

Exit optimisation yields at most a 0.3 Sharpe improvement and reduces drift slightly — but all variants still fail. Zero windows pass under any exit configuration. When entry logic is regime-dependent, exit optimisation is rearranging deck chairs. The 14.8pp mean drift comes from the entry signal, not from exit timing.

8. MACD vs SMA: Direct Comparison

Because both studies used identical testing conditions — same pair, same timeframe, same windows, same costs, same kill filter — the results are directly comparable. This is the table traders actually want.

MetricBest SMA20/100 crossBest MACD12/26/9 defaultWinner
OOS Sharpe+1.24+1.78MACD
Net Expectancy+4.37 pips+7.37 pipsMACD
OOS Win Rate53.2%57.6%MACD
Avg Trades/Window11.39.8SMA (lower exposure)
Mean Drift11.3pp9.2ppMACD (lower drift)
Windows Passing Drift2 / 60 / 6SMA
Drift Kill Rate64.0%90.7%SMA (more robust)
Survived full filter?❌ No❌ NoNeither

The verdict: MACD produces better aggregate metrics in the best-case comparison (+1.78 vs +1.24 Sharpe, +7.37 vs +4.37 pips). But SMA crossovers are more regime-robust — 64% drift kill rate vs 90.7%, and the best SMA variant actually passed 2 of 6 windows where the best MACD variant passed zero. If you are choosing between the two for a standalone trend-following signal on H4 EUR/USD, SMA is the more deployable baseline. Neither is deployable without additional regime conditioning.

Building a Combination Strategy

The data from both studies points toward the same conclusion: neither indicator works alone. The next step is combination testing — MACD confirmation layered onto SMA trend identification, with regime filters. Building that in MQL5 is a multi-indicator EA that most traders cannot code themselves. StratForge generates it from a conversational interview. Describe your logic; receive the code.

Build a MACD + SMA combination EA →

9. Why This Matters

For Retail Traders

If you are using MACD based on a trading course, MT5 default settings, or a backtest you ran yourself, here is what the data says about your situation.

1. Your backtest is almost certainly wrong

  • No walk-forward validation means you are fitting to the entire dataset
  • No per-window drift check means the aggregate Sharpe (+1.78) hides that all 6 windows individually failed
  • No transaction costs means the 0.21 pip mean expectancy disappears entirely
  • 68 trades per window looks like a large sample — after autocorrelation adjustment, the effective independent observation count is approximately 38

If your own MACD backtest shows Sharpe above 1.5 on 10 years of data, you have a lookahead bias problem or insufficient overfitting controls.

2. Your live trading will significantly underperform your backtest

ScenarioIS Win RateExpected OOSAfter 2 Pip Cost
Optimistic (5pp drift)55%50%Breakeven
Realistic (14.8pp drift)55%40.2%-3 to -5 pips/trade
Worst case (22pp drift)55%33%-8 to -12 pips/trade

3. Parameter optimisation makes it worse

The typical optimisation process:

  1. Run MACD on historical data
  2. Optimise fast/slow/signal parameters for best Sharpe
  3. Find MACD 11/23/8 with Sharpe +2.1
  4. Deploy live
  5. Lose money

What actually happened: you tested 75+ combinations and selected the luckiest overfit. It has 18–25pp drift on per-window analysis. It will fail in live trading. Our data tested all 75 so you can skip this step.

For Strategy Developers

MACD is not worthless — it is misunderstood and misapplied. Four paths to using it correctly:

Option 1: Regime Conditioning (Required, Not Optional)

MACD alone produces a 90.7% drift kill rate. Combinations to test: MACD + ADX > 25 (confirm trending regime before entry); MACD + ATR percentile filter (trade only during elevated volatility); MACD + session filter (London/NY open only, avoiding overnight sessions). Warning: our Ichimoku + ADX testing showed regime filters can increase drift in some windows. Regime conditioning is necessary but not sufficient.

Option 2: Ensemble Diversification

Instead of one MACD variant on one pair, deploy 5 MACD variants across 5 uncorrelated pairs (cross-pair correlation < 0.7). Position sizing must account for correlation. Expected aggregate Sharpe: approximately 0.4–0.6. Not impressive, but potentially stable.

Option 3: MACD as Confirmation, Not Primary Signal

Never use MACD crossover as a standalone entry reason. Use it to confirm a signal from a primary indicator: RSI < 30 (oversold) AND MACD crosses above signal → long; price breaks key support AND MACD crosses below signal → short; Ichimoku Cloud bullish AND MACD confirms → long. Phase 3 of this study will test combination approaches under the same methodology.

Option 4: MACD Histogram Divergence Instead of Line Crossover

This study tested line crossovers only. Histogram divergence (price makes a new low, MACD histogram makes a higher low) operates at lower signal frequency — approximately 15–20 trades per window. Lower frequency means less regime microstructure exposure. Hypothesis: drift may reduce to 8–10pp range. Not tested in Phase 2; remains speculative until Phase 3 results.

10. Frequently Asked Questions

What are the best MACD settings for MT5?
Our 13-year walk-forward backtest found the default 12/26/9 setting (Gerald Appel's original 1979 specification) to be the best-performing of 75 configurations, with an OOS Sharpe of +1.78 and net expectancy of +7.37 pips. No optimised variant outperformed it by more than 0.3 Sharpe units. However, 12/26/9 still failed — every single one of its 6 validation windows exceeded the 5pp drift threshold. Parameter optimisation of MACD is counterproductive: the indicator itself is the constraint.
Does MACD work for forex trading?
MACD works inconsistently and unpredictably. Our data shows it produced positive Sharpe ratios in 3 of 6 validation windows — but not always in the windows you would expect. The best single-window Sharpe (+1.78) came from a ranging market, not a trending one. As a standalone signal, it is not deployable. As a confirmation tool combined with regime filtering, it may have value — but that is untested in this study and will be covered in Phase 3.
Is MACD or SMA better for trend following?
Based on identical testing methodology, SMA crossovers significantly outperformed MACD on regime robustness. SMA average drift was 9.2pp vs MACD at 14.8pp — 61% worse. SMA drift kill rate was 64% vs MACD at 90.7%. For trend following on H4 timeframes, SMA crossovers are the more stable baseline — though neither survived the full filter unassisted.
Why does MACD look profitable in backtests but fail in live trading?
Three compounding problems. First, most retail backtests optimise over the full dataset — fitting to future data. Second, aggregate metrics conceal per-window instability: MACD 12/26/9 shows an aggregate Sharpe of +1.78, but that is the average of three negative and three positive windows, all with severe drift. Third, the high signal frequency causes MACD to learn regime-specific microstructure — specific price levels, news event patterns, session timing — that does not transfer to future periods.
Does optimising MACD parameters improve performance?
No. This is one of the clearest findings in our study. After testing 75 parameter combinations, no variant outperformed the default by more than 0.3 Sharpe units. If you optimised MACD on your own historical data and found a 'better' setting, you found the luckiest overfit — not the best signal. It will fail in live trading.
How do you use MACD correctly in MT5?
Based on our data, MACD should not be used as a standalone entry signal. It should be used as a confirmation tool, combined with a primary signal that identifies regime context. Effective frameworks include: RSI oversold AND MACD crosses above signal for long entries; price breaks a key support level AND MACD confirms bearish cross for short entries. MACD confirms momentum direction — it should not be the reason you enter a trade.

11. Next in the Series

This is Part 2 of the MT5 Indicator Backtest Series. Every study uses the same methodology, the same dataset, and the same 5-stage kill filter — making results directly comparable across indicator families.

Part 1 — Read previous

SMA Crossover Analysis

25 variants · 13 years · 0 survivors · 64% drift kill rate

Part 3 — Coming next

RSI Overbought / Oversold Analysis

Testing 11 RSI configurations under identical methodology. Results pending.

Put This Research to Work

The clearest finding from both studies: single-indicator strategies need regime conditioning to be deployable. MACD + ADX, MACD + RSI confirmation, SMA + MACD combination — these require multi-indicator MQL5 EAs most traders cannot build themselves. StratForge generates complete, reviewed EA code from a conversational strategy interview. No coding required. Your own Anthropic API key means you pay Anthropic directly — typically a few cents per generation.

Generate a Custom MACD EA →