The MACD (Moving Average Convergence Divergence) is a technical indicator developed by Gerald Appel. It consists of three elements commonly called DIF, DEA and MACD (or Histogram). Here is how they work:
1) DIF (or MACD line)
The DIF is the difference between two exponential moving averages (EMA) of different lengths, often the EMA 12 and the EMA 26.
Formula: DIF = EMA(12) – EMA(26)
When this value is positive, the short-term trend (EMA 12) is higher than the medium-term trend (EMA 26), suggesting bullish potential. Otherwise, it is estimated that there is bearish pressure.
2) DEA (or Signal line)
The DEA is an EMA (usually of period 9) applied to the value of the DIF. Formula: DEA = EMA(9) of the DIF
It is often used as a confirmation line. In particular, the crossing between DIF and DEA is monitored to detect bullish signals (DIF passing above the DEA) or bearish signals (DIF passing below the DEA).
3) MACD (Histogram)
The MACD, in some platforms, designates the histogram that materializes the gap between the DIF and the DEA.
Formula: MACD (Histogram) = DIF – DEA
A widening histogram can reflect a strengthening of the current trend (up if the DIF is above the DEA, down if the opposite occurs). A decrease in the histogram can signal a weakening of the current trend.
In summary, DIF, DEA and MACD (Histogram) work together to show the relationship between two trends (short and medium) and their evolution over time. These lines and their interaction are used to identify potential reversals or trend confirmations. Like any indicator, it is best used in conjunction with other tools (volume analysis, RSI, etc.) to obtain a more reliable view of the market.