Calculation of MACD Formula

2023-06-05
Summary:

Uncover the MACD formula and calculation method for insightful trading strategies. Master MACD calculation to improve investment decisions in forex.

How to Calculate MACD Formula 

MACD should first calculate the fast (usually 12 days) moving Average value and the slow (usually 26 days) moving average value in application. Use these two values as the basis for measuring the "difference value" between the two (fast and slow lines).


The so-called "difference value" (DIF) refers to the 12 day EMA value minus the 26 day EMA value. Therefore, in the sustained upward trend, the 12th EMA is above the 26th EMA. The positive deviation value (+DIF) between them will become larger and larger. On the contrary, in a downward trend, the difference value may become negative (- DIF) and also increase.


As for the degree to which the positive or negative deviation value needs to be reduced when the market starts to turn around, it is truly a signal of market reversal. The reversal signal of MACD is defined as the 9-day moving average (9-day EMA) of the "difference value".

MACD

The calculation formula for MACD indicators involves three parts: fast line, slow line, and bar chart.

1. Calculate Fast Line (EMA12)

Firstly, it is necessary to calculate the 12 day average index (EMA12) of the closing price, which is:

EMA12=Previous day EMA12 x 11/13+Today's closing price x 2/13

Among them, 11/13 and 2/13 are weighting coefficients that can be adjusted according to different analysis requirements.


2. Calculate Slow Line (EMA26)

Next, it is necessary to calculate the 26 day average index (EMA26) of the closing price, which is:

EMA26= Previous day EMA26 x 25/27+Today's closing price x 2/27

Similarly, 25/27 and 2/27 are weighted coefficients.


3. Calculate Bar Charts (DIF and DEA)

Finally, the difference between the fast and slow lines can be used as a bar chart (DIF) to measure price momentum and trend changes, while also calculating the 9-day moving average (DEA) of the DIF, which is:

DEA=previous day's DEA x 8/10+today's DIF x 2/10


Finally, the calculation formula for MACD indicators can be expressed as:

MACD= DIF - DEA

Its IF is the difference between the fast line and the slow line, DEA is the 9-day moving average of DIF, and MACD is the bar chart. It should be noted that the value of MACD index can be positive, negative or zero, and its size and direction reflect the change and trend intensity of market price.


【 EBC Platform Risk Reminder and Disclaimer 】: There are risks in the market, and investment needs to be cautious. This article does not constitute investment advice.

Inverted Hammer Candlestick: Signals & Strategies

Inverted Hammer Candlestick: Signals & Strategies

What is the Inverted Hammer candlestick pattern? Learn how to identify and trade this bullish reversal signal effectively across financial markets.

2025-03-12
MOVE Index: Key Indicator for Bond Market Volatility

MOVE Index: Key Indicator for Bond Market Volatility

What is the MOVE Index? Learn how this key bond market volatility indicator works, its relationship with the VIX, and its impact on investment decisions.

2025-03-11
What are G10 Currencies? How They Impact the Market

What are G10 Currencies? How They Impact the Market

Understanding G10 currencies is key for forex traders. Explore the economic indicators and external factors that shape their strength and volatility.

2025-03-11