MACD indicator explained: how to read it
By Oalgo · Last reviewed
The MACD indicator (Moving Average Convergence Divergence) is the gap between a fast moving average and a slow one. The usual settings are a 12-period and a 26-period EMA, plus a 9-period average of that gap.
How is MACD calculated?
#- Take two exponential moving averages (EMAs) of the close: a fast one over 12 candles and a slow one over 26.
- MACD line = fast EMA − slow EMA.
- Average line = a 9-period EMA of the MACD line.
- Histogram = MACD line − average line.
How do you read MACD?
#| What you see | What it suggests |
|---|---|
| MACD line above zero | The fast EMA is above the slow EMA. Recent prices are higher than the longer average. |
| MACD line below zero | The fast EMA is below the slow EMA. Recent prices are lower than the longer average. |
| MACD line crosses above the average line | Momentum has turned up. The histogram moves from below zero to above it. |
| MACD line crosses below the average line | Momentum has turned down. The histogram moves from above zero to below it. |
MACD is built from moving averages, so it follows price instead of leading it. In a sideways market the two lines cross back and forth, and most of those crosses lead nowhere.
How do people use MACD in rules?
#- The MACD line crossing above or below the average line.
- The MACD line crossing above or below zero.
- The histogram changing from negative to positive, or the other way round.
- MACD next to a second indicator, such as RSI, so that two conditions must agree.
What can MACD not tell you?
#MACD does not say how far a move will go. A cross often comes after part of the move has already happened, and a cross does not promise that price will keep going. Test any rule on past prices with a backtest, then forward test it.
In Oalgo you can tell Oalgo AI your MACD rule in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.
Read next
- Moving averages: SMA and EMA explainedA moving average smooths price into one line. Learn how the SMA and EMA are calculated, how they differ, and how to use them in your own rules.
- What is RSI? The RSI indicator explainedThe RSI indicator compares recent up moves with down moves on a scale from 0 to 100. Learn how it is calculated, how to read it, and how to test RSI rules.