OPEN-SOURCE SCRIPT
DaringBull Arvind MACD GAPS MA Crossover

To generate buy and sell signals based on a combination of MACD crossover events and histogram behavior, particularly around the zero line. This is used to identify early momentum reversals for entry and exit points in the market.
📐 MACD Setup
Uses customizable MACD parameters (defaults: Fast = 12, Slow = 26, Signal = 9).
Calculates:
MACD Line
Signal Line
Histogram (difference between MACD and Signal)
✅ Buy Conditions
A buy signal is plotted when all three of the following occur:
MACD Line crosses above Signal Line (bullish crossover).
MACD Line is still below or near the zero line (< 0.05) – indicates early reversal from a bearish zone.
First green histogram bar appears (current bar is > 0 and previous was ≤ 0) – confirming momentum shift.
➡️ When these align, a blue circle is plotted below the price bar.
❌ Sell Conditions
A sell signal is plotted when all three of the following occur:
MACD Line crosses below Signal Line (bearish crossover).
MACD Line is still above or near the zero line (> -0.05) – indicates early weakness after a bullish move.
First red histogram bar appears (current bar is < 0 and previous was ≥ 0) – confirming loss of momentum.
➡️ When these align, a red circle is plotted above the price bar.
📊 Visualization
Buy/Sell markers appear on the price chart for visual entry/exit cues.
MACD line, Signal line, and Zero line are optionally plotted for deeper analysis.
📌 Key Insights
This script aims to enter trades early in trend reversals by using MACD in conjunction with histogram shifts near the zero line.
It's especially useful in gap trading, mean reversion, or breakout confirmation setups.
The optional plot toggle allows switching between overlay and non-overlay views.
📐 MACD Setup
Uses customizable MACD parameters (defaults: Fast = 12, Slow = 26, Signal = 9).
Calculates:
MACD Line
Signal Line
Histogram (difference between MACD and Signal)
✅ Buy Conditions
A buy signal is plotted when all three of the following occur:
MACD Line crosses above Signal Line (bullish crossover).
MACD Line is still below or near the zero line (< 0.05) – indicates early reversal from a bearish zone.
First green histogram bar appears (current bar is > 0 and previous was ≤ 0) – confirming momentum shift.
➡️ When these align, a blue circle is plotted below the price bar.
❌ Sell Conditions
A sell signal is plotted when all three of the following occur:
MACD Line crosses below Signal Line (bearish crossover).
MACD Line is still above or near the zero line (> -0.05) – indicates early weakness after a bullish move.
First red histogram bar appears (current bar is < 0 and previous was ≥ 0) – confirming loss of momentum.
➡️ When these align, a red circle is plotted above the price bar.
📊 Visualization
Buy/Sell markers appear on the price chart for visual entry/exit cues.
MACD line, Signal line, and Zero line are optionally plotted for deeper analysis.
📌 Key Insights
This script aims to enter trades early in trend reversals by using MACD in conjunction with histogram shifts near the zero line.
It's especially useful in gap trading, mean reversion, or breakout confirmation setups.
The optional plot toggle allows switching between overlay and non-overlay views.
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.