OPEN-SOURCE SCRIPT
MACD Differential Crossover Alerts & Arrows

🔥 MACD Differential Crossover Alerts & Arrows
This lightweight yet powerful indicator tracks momentum shifts using the MACD Differential — the difference between the MACD Line and its Signal Line. When this differential crosses the zero line, it often signals the start of a new trend or an early momentum reversal.
✅ Core Logic:
MACD Line = EMA(Fast Length) − EMA(Slow Length)
Signal Line = EMA(MACD Line, Signal EMA Length)
MACD Differential = MACD Line − Signal Line
📈 Visual Cues:
White Up Arrow when the MACD Differential crosses above zero (bullish signal)
White Down Arrow when it crosses below zero (bearish signal)
Ideal for fast-paced setups on 1-min to 15-min charts
⚙️ Customizable Settings:
Setting Type Default Description
Fast EMA Length Integer 9 Sets the short-term EMA for the MACD Line
Slow EMA Length Integer 20 Sets the long-term EMA for the MACD Line
Signal EMA Length Integer 6 Smooths the MACD Line to form the Signal Line
Show Arrows Boolean true Toggles visibility of up/down arrows on chart
Enable Alerts Boolean true Enables alert conditions for crossover events
🔔 Built-in Alerts:
"MACD Diff crossed ABOVE zero" → Bullish momentum alert
"MACD Diff crossed BELOW zero" → Bearish momentum alert
This lightweight yet powerful indicator tracks momentum shifts using the MACD Differential — the difference between the MACD Line and its Signal Line. When this differential crosses the zero line, it often signals the start of a new trend or an early momentum reversal.
✅ Core Logic:
MACD Line = EMA(Fast Length) − EMA(Slow Length)
Signal Line = EMA(MACD Line, Signal EMA Length)
MACD Differential = MACD Line − Signal Line
📈 Visual Cues:
White Up Arrow when the MACD Differential crosses above zero (bullish signal)
White Down Arrow when it crosses below zero (bearish signal)
Ideal for fast-paced setups on 1-min to 15-min charts
⚙️ Customizable Settings:
Setting Type Default Description
Fast EMA Length Integer 9 Sets the short-term EMA for the MACD Line
Slow EMA Length Integer 20 Sets the long-term EMA for the MACD Line
Signal EMA Length Integer 6 Smooths the MACD Line to form the Signal Line
Show Arrows Boolean true Toggles visibility of up/down arrows on chart
Enable Alerts Boolean true Enables alert conditions for crossover events
🔔 Built-in Alerts:
"MACD Diff crossed ABOVE zero" → Bullish momentum alert
"MACD Diff crossed BELOW zero" → Bearish momentum alert
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.