Setting Up Moving Average Convergence Divergence (MACD) for Expert Analysis
MACD (moving average convergence divergence) is a momentum indicator equal to a stock's 12-day exponential moving average (EMA) minus its 26-day EMA. A 9-day EMA of the MACD line is plotted as the signal line, and the histogram shows the gap between the two. The standard setup is therefore 12, 26, 9. When MACD crosses above the signal line, momentum is turning up (a bullish crossover); when it crosses below, momentum is turning down (a bearish crossover).
What is MACD?
MACD is a technical indicator used on stocks, ETFs, forex and other markets to show the direction and strength of a trend. Because it is built from two moving averages, it follows the trend but reacts faster than a simple moving average crossover.
How MACD is calculated
- MACD line = 12-day EMA − 26-day EMA of closing prices.
- Signal line = 9-day EMA of the MACD line.
- Histogram = MACD line − signal line.
MACD above zero means the shorter-term average is above the longer-term one, a sign of upward momentum; below zero signals downward momentum.
How to set up MACD
Most charting platforms offer MACD with the default 12, 26, 9 settings, and those are the usual starting point. Shorter settings (for example 5, 35, 5) react faster but give more false signals; longer settings are smoother but slower. Test any change on the stocks and timeframe you trade before relying on it.
How to interpret MACD signals
- Signal-line crossovers: MACD crossing above the signal line is a bullish crossover; crossing below is bearish.
- Zero-line crossovers: MACD moving above zero confirms upward momentum; moving below zero confirms downward momentum.
- Divergence: price making a new high while MACD makes a lower high can warn that momentum is fading.
MACD lags price and gives false signals in sideways markets, so confirm it with other tools, such as volume-based indicators like On-Balance Volume (OBV), and with price trend.
How to calculate MACD in Excel with MarketXLS
MarketXLS returns exponential moving averages as Excel formulas, so the MACD line is one cell: =ExponentialMovingAverage("AAPL", 12) - ExponentialMovingAverage("AAPL", 26). MarketXLS also provides a generic indicator function, =TechnicalIndicator("AAPL", "MACD"). Copy the formulas down a list of tickers to screen for stocks with MACD above zero. See MarketXLS technical indicators for the full list.
Conclusion
MACD compares a 12-day and 26-day EMA to show momentum, with a 9-day signal line for crossovers. Use the default 12, 26, 9 settings as a baseline, confirm signals with volume and trend, and do not trade on MACD alone. This article is educational and not investment advice.
Browse the MarketXLS templates library for technical analysis models.
Relevant blogs that you can read to learn more about the topic
What is the MACD Indicator and How Can it Help You Trade?
On Balance Volume (Formula In Excel)
Marketxls New Release Version 9.2
Technical Indicators – Meaning & Application
Technical Indicators For Swing Traders (Using Marketxls)

