Financial markets move fast and prices change constantly. Many participants buy and sell assets across global markets each day. This continuous movement makes price analysis difficult at times. Technical indicators are used to study these changes through mathematical calculations on charts. One widely used tool is the MACD indicator. It compares moving averages to study price behavior over time. This approach supports structured analysis and reduces emotional reactions during market activity.
This article explains the Moving Average Convergence Divergence indicator, also known as MACD, within technical analysis. The next sections describe how the MACD is calculated, its main components, and how it is used in trading.
What is the MACD Indicator
The MACD indicator is a tool used in financial markets to show changes in a price trend. It measures the difference between two moving averages of an asset's price. The indicator has two lines and a histogram. The first line comes from subtracting a longer moving average from a shorter one. The second line is a smooth version of the first line. The histogram shows the difference between the two lines. When the histogram changes, it can suggest that the price trend may be shifting. The term MACD is short for Moving Average Convergence Divergence. It reflects how two moving averages move relative to each other over time.
Gerald Appel developed the MACD line in 1979, and Thomas Aspray later added the histogram feature in 1986. The Moving Average Convergence Divergence (MACD) indicator, tracking the relationship between two different exponential moving averages, is a widely used tool in technical analysis that assists in forming trading strategies in financial markets. So, if you were to ask why the MACD indicator is so popular, the answer is quite simple. This is because the MACD is formed by the intersection of three distinct types of indicators. Among these types, it stands out as a Trend indicator, which is based on moving averages; a Momentum indicator, expressed with a histogram; and a Signal indicator that utilizes moving average crossovers to generate buy and sell signals. This is because the MACD indicator gives us a comprehensive overview of the market momentum, trends and possible reversal points.
MACD Formula and Structural Components
The MACD indicator is formed by the combination of three main components as a standard. These are two exponential moving averages, a signal line, and a histogram. Let's now look at the details of how these components are calculated.
1. MACD Line
Typically shown in blue on the indicator, this line is calculated by subtracting the 26-period exponential moving average value from the 12-period exponential moving average value:
12 EMA - 26 EMA
In other words, the indicator automatically calculates the difference between these two exponential moving averages to draw the MACD line (blue line). Here, to calculate the 12-day EMA, the initial EMA value is taken as the closing price of the first day. The EMA value for the second day is calculated using the formula EMA = (Closing Price - Previous Day's EMA) × (2 / 13) + Previous Day's EMA, and these steps are continued to calculate the 12-day EMA value for each day. The same method is used to calculate the 26-day EMA.
2. Signal Line
Also called the trigger line, the signal line is usually shown in orange or red on the MACD indicator. It is calculated by taking the exponential moving average (EMA) of the last 9 periods of the MACD line. This calculation smooths the MACD line and reduces short-term fluctuations.
The signal line helps identify trend changes in price movement. When the MACD line rises above the signal line, it may indicate the start of an upward trend. When the MACD line falls below the signal line, it may indicate the start of a downward trend. Active users often watch how the MACD line interacts with the signal line to decide timing for trades.
The distance between the MACD line and the signal line is also important. A growing distance may show increasing trend strength, while a shrinking distance may suggest that the trend is losing strength. The signal line works together with the MACD line to provide a visual guide of market direction and trend shifts.
3. Histogram
Presented in bar graph format, the histogram illustrates the distance between the MACD and the signal line using a series of changing-length lines.
Histogram = MACD Line - Signal Line
As prices change, the difference between the MACD line and the signal line also changes. The histogram makes this difference easily readable in the form of bar graph. In the middle of the histogram, there's a 0 (zero) line. The 0 line signifies the intersection point of the MACD line and the signal line, determining their relative positions. The zone above the 0 line is the Positive zone, while the zone below it is the Negative zone. When the MACD line is at the 0 line, the 12-day EMA equals the 26-day EMA (12 EMA = 26 EMA). In the Positive zone, the 12-day EMA is greater than the 26-day EMA (12 EMA > 26 EMA), and in the Negative zone, the 12-day EMA is smaller than the 26-day EMA (12 EMA < 26 EMA).
Basically, the MACD indicator formula calculates the difference between a short-term moving average and a long-term moving average. This formula produces the first line of the MACD. A second line is created by applying a moving average to the first line. The histogram shows the gap between these two lines.
Traders use the MACD indicator formula to find changes in price trends. When the histogram grows or shrinks, it reflects the movement between the two moving averages. Understanding the MACD indicator formula helps in spotting trend shifts and timing entry or exit points.
How to Use the MACD Indicator
The MACD indicator strategy focuses on changes between two moving averages. The MACD line crossing above the signal line may show upward price movement. Crossing below the signal line may show downward movement. The histogram shows the difference between the MACD line and the signal line. Taller bars can indicate a stronger trend. Shorter bars may indicate a weaker trend.
This MACD indicator strategy can be combined with other tools to decide entry or exit points. Watching both the lines and the histogram gives a visual view of price changes. The MACD indicator strategy works on different time frames, including daily and hourly charts.
The MACD indicator is widely used in financial markets for trading purposes. In the indicator, when the MACD line crosses above the 0 (zero) line, it signals an upward trend. Conversely, when the MACD line crosses below the 0 (zero) line, it indicates a downward trend. If the MACD line (Blue line) crosses the Signal line (Orange line) above the zero line in the negative zone, we enter a Buy order. If the blue line intersects the orange line in the positive zone, it would be more reasonable to enter a short-term Buy order. If the MACD line (Blue line) crosses below the Signal line (Orange line) in the positive zone, we place a Sell order, if it crosses in the negative zone, we enter a short-term Sell order.
![]() |
| Trading via MACD on the USD/CAD chart |
In addition, we can also trade with divergences in the MACD indicator. The above example illustrates trading with positive regular divergence and negative exaggerated divergence on the US Dollar/Canadian Dollar chart. If you are interested in how to trade with divergences, check out this article Divergences.
What are the MACD Indicator Best Settings?
The MACD indicator settings do not have a single correct value. They change depending on the asset and the time frame. Standard numbers like 12, 26, 9 are common, but they may not show the full picture for every chart. A dynamic approach can reveal trends that standard settings hide. The MACD indicator best settings shift when the histogram shows unusual behavior. For example, a shrinking histogram may look like a trend is ending. Adjusting the short-term and long-term averages slightly can reveal that the trend is still active.
Time frame matters. Short-term charts may need faster MACD indicator settings. Long-term charts may work better with slower settings. A single setting cannot cover all markets. Some assets behave differently. Cryptocurrencies often move quickly. Stocks may have slower trends. Commodities can react to external events. The MACD indicator best settings are discovered by testing each asset individually and observing how line crossings and histogram changes appear.
A practical scenario: The MACD line crosses the signal line, but the histogram shrinks. Standard settings might suggest exiting. Small adjustments to the MACD indicator settings can show that the trend is not over, allowing observation of movements that others may miss. The MACD indicator setup is not static. Adjusting moving averages and the signal period can create a personalized view of price action. Users can experiment with numbers to see how trends behave differently across assets, time frames, and volatility conditions.
This method shows that best settings are not fixed. The MACD indicator best settings depend on experimentation, observation, and adaptation. Each chart may require a slightly different approach to reveal the true price behavior.
⚠ Forex markets carry risk and prices can move fast. Leverage can increase both gains and losses. Using only one indicator, including the MACD indicator, can lead to poor decisions. Sideways markets may produce misleading signals. Technical indicators work better when combined with other analysis tools. Every trading decision should be made with care and personal judgment.
What Traders Always Ask About MACD
Find Quick Answers to the most Frequently Asked Questions About the MACD Indicator here. Get the facts you need quickly so you can apply these insights to your next trade. .
