OPEN-SOURCE SCRIPT
MACD Positive & Negative Alert

The MACD (Moving Average Convergence Divergence) is a momentum and trend-following indicator that helps traders identify the strength and direction of a trend, spot potential reversals, and fine-tune entry/exit timing.
Core Components
- MACD Line:
The difference between the 12-period and 26-period EMA (Exponential Moving Averages). This line highlights shifts in momentum and identifies the prevailing trend direction.
- Signal Line:
A 9-period EMA of the MACD line, acting as a trigger for buy/sell signals. When the MACD line crosses above the signal line, it suggests a bullish signal; when it crosses below, it suggests a bearish one.
- Histogram:
Shows the difference between the MACD line and the signal line as a bar graph. The histogram helps traders gauge the strength of the momentum and can warn of possible reversals. A rapidly growing histogram means strengthening momentum, while a shrinking one indicates weakening momentum.
Main Uses
- Trend Identification:
A positive MACD value typically signals a bullish trend, while a negative value signals a bearish trend.
- Momentum Analysis:
Divergences between MACD and price can warn of upcoming reversals. Increasing MACD histogram bars confirm strong momentum; shrinking bars suggest consolidation or reversal.
- Signal Generation:
Crossovers between the MACD line and the signal line generate trade signals—bullish (buy) if the MACD moves above the signal, bearish (sell) if it falls below l.
Example Interpretation
- MACD Crossover:
If the MACD line crosses above the signal line, it's often considered a buy signal; a cross below is a sell signal.
- Zero Line Cross:
If the MACD histogram moves from below zero to above, this is considered a bullish momentum shift; above zero to below is a bearish move.
The MACD is most effective in trending markets and should ideally be used alongside additional indicators for robust trading decisions.
Core Components
- MACD Line:
The difference between the 12-period and 26-period EMA (Exponential Moving Averages). This line highlights shifts in momentum and identifies the prevailing trend direction.
- Signal Line:
A 9-period EMA of the MACD line, acting as a trigger for buy/sell signals. When the MACD line crosses above the signal line, it suggests a bullish signal; when it crosses below, it suggests a bearish one.
- Histogram:
Shows the difference between the MACD line and the signal line as a bar graph. The histogram helps traders gauge the strength of the momentum and can warn of possible reversals. A rapidly growing histogram means strengthening momentum, while a shrinking one indicates weakening momentum.
Main Uses
- Trend Identification:
A positive MACD value typically signals a bullish trend, while a negative value signals a bearish trend.
- Momentum Analysis:
Divergences between MACD and price can warn of upcoming reversals. Increasing MACD histogram bars confirm strong momentum; shrinking bars suggest consolidation or reversal.
- Signal Generation:
Crossovers between the MACD line and the signal line generate trade signals—bullish (buy) if the MACD moves above the signal, bearish (sell) if it falls below l.
Example Interpretation
- MACD Crossover:
If the MACD line crosses above the signal line, it's often considered a buy signal; a cross below is a sell signal.
- Zero Line Cross:
If the MACD histogram moves from below zero to above, this is considered a bullish momentum shift; above zero to below is a bearish move.
The MACD is most effective in trending markets and should ideally be used alongside additional indicators for robust trading decisions.
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.