OPEN-SOURCE SCRIPT
SmartMind2

The MACD (Moving Average Convergence Divergence) is a popular technical indicator in trading, primarily used to detect trends and possible reversal points.
How is the MACD structured?
The MACD indicator consists of three components:
MACD Line:
Calculated as the difference between two exponential moving averages (EMAs), commonly 12 and 26 periods.
Formula:
MACD Line
=
𝐸
𝑀
𝐴
12
(
Price
)
−
𝐸
𝑀
𝐴
26
(
Price
)
MACD Line=EMA
12
(Price)−EMA
26
(Price)
Signal Line:
An exponential moving average (usually 9 periods) of the MACD line.
Formula:
Signal Line
=
𝐸
𝑀
𝐴
9
(
MACD Line
)
Signal Line=EMA
9
(MACD Line)
Histogram:
Graphically represents the difference between the MACD line and the Signal line.
Formula:
Histogram
=
MACD Line
−
Signal Line
Histogram=MACD Line−Signal Line
Interpretation of MACD:
Buy Signal: Occurs when the MACD line crosses above the signal line (bullish signal).
Sell Signal: Occurs when the MACD line crosses below the signal line (bearish signal).
Trend Reversal: A divergence between price movements and the MACD indicates a potential reversal (e.g., rising prices with a falling MACD).
How is the MACD structured?
The MACD indicator consists of three components:
MACD Line:
Calculated as the difference between two exponential moving averages (EMAs), commonly 12 and 26 periods.
Formula:
MACD Line
=
𝐸
𝑀
𝐴
12
(
Price
)
−
𝐸
𝑀
𝐴
26
(
Price
)
MACD Line=EMA
12
(Price)−EMA
26
(Price)
Signal Line:
An exponential moving average (usually 9 periods) of the MACD line.
Formula:
Signal Line
=
𝐸
𝑀
𝐴
9
(
MACD Line
)
Signal Line=EMA
9
(MACD Line)
Histogram:
Graphically represents the difference between the MACD line and the Signal line.
Formula:
Histogram
=
MACD Line
−
Signal Line
Histogram=MACD Line−Signal Line
Interpretation of MACD:
Buy Signal: Occurs when the MACD line crosses above the signal line (bullish signal).
Sell Signal: Occurs when the MACD line crosses below the signal line (bearish signal).
Trend Reversal: A divergence between price movements and the MACD indicates a potential reversal (e.g., rising prices with a falling MACD).
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.