MACD is an acronym for Moving Average Convergence Divergence.
On a MACD chart you will usually see three numbers that are used for its settings.

The most common setting for MACD parameters is "12, 26, 9", these values being interpreted as follows:
There is a general misconception when it comes to MACD lines.
The two lines are not mobile averages. Instead, they are the moving averages of the difference between the two mobile averages.
The slower moving average divides the average of the previous MACD line.
Again, from our example above, this would be a moving average of 9 periods. This means that the fast moving average of the last 9 periods of the MACD line is divided to our slower mobile average.
If we look at our original chart, it can be noticed that since the two moving averages separate, the histogram becomes larger. This is called divergence, because the faster average is "divergent" or moving away from the slower average
then the moving averages approach each other, the histogram becomes smaller. This is called convergence, because the faster average is "converging" or moving closer to the slower average.
Hence the name of the indicator - Moving Average Convergence Divergence.
Use of MACD in trading
Because there are two moving averages with different "speeds", the fastest reacts earlier to price movements. When a trend change occurs, the fast line will react more quickly and eventually break through the slower line.
When this happens - the "intersection" - and the fast line begins to move away from the slower line, the formation of a new trend is signaled.
From the graph above, it can be seen that the fast line has passed below the slow line and a downward trend has been formed. Note that when the lines cross the histogram temporarily disappears. This is because the difference between the lines at the time of crossing is 0.
As the descending trend begins, the fast line diverges away from the slow line, the histogram becomes larger, which is a good indication of a strong trend.
There is a disadvantage to MACD. Naturally, mobile averages tend to remain behind the price. After all, it's just an average of historical prices.
Since MACD is a moving average of other mobile averages, that are virtually smoothed, you can imagine that there is a slight delay.
Another way of identifying a new trend or confirming the continuation of the current one with MACD indicator is by using divergences.
Divergences are formed when there is a discrepancy between the price and the technical indicator.
This discrepancy is often observed in oscillators - ex: RSI, MACD, CCI Slow Stochastic etc. Indeed, these indicators give the best signals when they form differences to price movement.
So an early indication of impulse change is given by divergence, and a change in impulse is often the main indication for a trend shift.
There are three types of divergences:
Regular Divergence - the two hypotheses

Hidden Divergence - the two hypotheses


Continously Divergence - the two hypotheses

