MACD (Moving Average Convergence / Divergence) is a technical indicator that measures the strength of the price movement. It is made up of two MACD and Signal Lines and a Histogram. The author did it thinking about the daily charts, so he decided that they were 12 and 26 which is approximately the Moving Average of half a month and a month of stock trading days. As it is of the Oscillator type, it allows us to measure the momentum of trends, in addition to detecting overbought or oversold states, that is, when the trend has gone too far and is ready for a short- term consolidation .
MACD is commonly used by analyzing crossovers, divergences, and periods of steep slope (positive or negative). It is calculated through the Difference between two exponential moving average lines of 12 and 26 periods . This difference can be seen on a separate chart (called the MACD line). It also has a 9-period moving average [1,3] line called the signal line (See Figure 1).
So to understand how the MACD oscillator is built we can see that when the 2 (MA)  above approach the main line of the MACD approaches its zero line, the central line measures the difference between the two Moving Averages (MA) when they touch, the main line MACD will show zero, there is no distance between them (See Figure 2). On the contrary, when the MAs separate, the main line moves away from 0 either above or below depending on which (MA) is above the other, thus indicating a possible upward or downward trend .
The histogram, which are these bars that are seen on the MACD chart, is nothing more than the difference between the main and signal lines (See Figure 3) .
Figure 3: Histogram in MACD
With these three elements main line, signal line and histogram we can obtain information that can be incorporated into our trading system. The MACD is very versatile and serves both to detect trends and states of overbought or oversold. The most common signals that the MACD throws are the following: when the main line crosses the 0 either up or down it could be indicating a possible change in trend and that is when the fast (MA) the 12 is above the slow at 26, the main MACD line will be above 0 indicating that the (MA) are aligned for a possible uptrend (See Figure 4). Otherwise, if the fast is below the slow, the main MACD line will be below zero .
Figure 4: MACD in Overbought and Oversold Behavior
Traders will then look for a long position when the MACD line crosses the signal line from the bottom up, and will take a short position when the MACD line crosses the signal line from the top down. On the other hand, it is also possible to find valuable information on the divergence between the MACD line and the current price.
Divergences (See Figure 5) are another type of signals that the MACD offers us, a divergence occurs when the price chart offers new highs or new lows during a trend and the main line of the MACD does not accompany, that is, they do not make the new ones. highs new lows and we have two types of divergence, the bearish and bullish divergence, the bearish divergence occurs when the main MACD line does not accompany making new maximums of the trend and in this case it is warning us that the uptrend is losing momentum or momentum and could be preparing to turn around, the bullish divergence which is just the opposite when the price chart is making new lows in a downtrend and the main MACD line does not accompany indicating loss of bearish momentum and possible exhaustion of the pure downtrend common sense because then because if a divergence occurs it means that the two (MA)  with which it is co It builds the MACD and generally those of 12 and 26 are getting progressively closer although new highs or lows are being produced which is a clear indication that the trend is losing strength I have used this signal a lot as confirmation of exhaustion patterns if you have a Exhaustion pattern with divergence in the MACD and breakout of the confirmation line is quite likely to produce some anti-trend movement.
Figure 5: MACD Divergence Behavior
We have seen the amount of profits that an indicator as versatile as the MACD, it is widely used because it is simple and easy, since it provides information about the strength of the trend (up or down), but also about the strength of the trends (buy and sell) signals. Its disadvantage is that it is a Short-Term Indicator, since its longest average is 26 days, which could not be useful for long-term investments. As it is also a trend-following indicator, this means that the indicator communicates a signal when the trend takes place, not before it begins.
 CobuildLab 2021. Technical Indicators for Trading.
 CobuildLab 2021. Technical Specifically Moving Average and Its Use for Financial Market
Analysis with python.
 Implementing MACD in Python https://towardsdatascience.com/implementing-macd-in-
 FD Life&trading Portal. El Indicador MACD. 2019.