What is the MACD calculation formula? Detailed Explanation of MACD Calculation Formula

2023-06-05
Summary:

When the MACD line crosses the signal line from bottom to top, it is usually considered a buy signal, while when the MACD line crosses the signal line from top to bottom, it is considered a sell signal. In addition, MACD indicators can also be combined with other technical indicators, such as RSI and Bollinger Bands, to improve the accuracy and reliability of trading decisions.

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".

What is the MACD calculation formula? Detailed Explanation of MACD Calculation Formula

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.

What is the status of the volume-price relationship?

What is the status of the volume-price relationship?

The volume-price relationship is a key stock market indicator, revealing the correlation between trading volume and stock prices. Analyzing these changes helps investors understand market activity and potential trend reversals.

2023-12-01
What is delisting?

What is delisting?

Delisting removes a stock from public trading. It's either voluntary or mandatory, due to violations, financial issues, mergers, etc.

2023-12-01
What does the exchange rate mean?

What does the exchange rate mean?

The exchange rate, reflecting the relative values of two currencies, is influenced by factors like currency supply and demand, balance of payments, economic growth rate, interest rates, monetary policy, and inflation.

2023-11-29