OPEN-SOURCE SCRIPT
MACD Zero Line Candles + Alert

█ OVERVIEW
This indicator recolors your candles based on whether the MACD line is above or below the zero line.
Green candles: MACD line is above 0 (bullish)
Red candles: MACD line is below 0 (bearish)
No need to watch the MACD panel — the candle color tells you the trend bias at a glance.
█ HOW IT WORKS
• Uses standard MACD settings (12, 26, 9)
• Candles turn green when the MACD line is above zero
• Candles turn red when the MACD line is below zero
█ ALERTS
Two alert conditions are included:
• MACD Line Cross Above 0 Alert — triggers when the MACD line crosses above zero (bullish shift)
• MACD Line Cross Below 0 Alert — triggers when the MACD line crosses below zero (bearish shift)
█ NOTES
• This indicator tracks the MACD line (fast EMA minus slow EMA), not the signal line
• For signal line-based candle coloring, see my other script: MACD Signal Line Candles + Alert
• For zero line-based background coloring instead of candle coloring, see my other script: MACD Zero Line Background + Alert
This indicator recolors your candles based on whether the MACD line is above or below the zero line.
Green candles: MACD line is above 0 (bullish)
Red candles: MACD line is below 0 (bearish)
No need to watch the MACD panel — the candle color tells you the trend bias at a glance.
█ HOW IT WORKS
• Uses standard MACD settings (12, 26, 9)
• Candles turn green when the MACD line is above zero
• Candles turn red when the MACD line is below zero
█ ALERTS
Two alert conditions are included:
• MACD Line Cross Above 0 Alert — triggers when the MACD line crosses above zero (bullish shift)
• MACD Line Cross Below 0 Alert — triggers when the MACD line crosses below zero (bearish shift)
█ NOTES
• This indicator tracks the MACD line (fast EMA minus slow EMA), not the signal line
• For signal line-based candle coloring, see my other script: MACD Signal Line Candles + Alert
• For zero line-based background coloring instead of candle coloring, see my other script: MACD Zero Line Background + Alert
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.