MACD Trading Strategy: A Practical Backtesting Guide
Learn how to use the MACD indicator to build momentum strategies and avoid common false signals.
The Moving Average Convergence Divergence (MACD) is one of the most popular momentum indicators. It tracks the relationship between two exponential moving averages of price, typically the 12-day and 26-day EMAs.
How to Read MACD
MACD consists of three components: the MACD line, the signal line (9-day EMA of MACD), and the histogram. A bullish signal occurs when the MACD line crosses above the signal line. A bearish signal occurs when it crosses below.
MACD Strategy Rules
- Long: MACD line crosses above signal line from below zero.
- Short: MACD line crosses below signal line from above zero.
- Filter: Only take signals in the direction of the higher timeframe trend.
Common Pitfalls
MACD is a lagging indicator. It works well in trending markets but produces many false signals in choppy, range-bound conditions. Combining MACD with trend filters or volume confirmation significantly improves results.
Backtest It
In NeuroBacktest, type: "Backtest MACD crossover on AAPL from 2020 to 2024 with fast 12, slow 26, signal 9."