OPEN-SOURCE SCRIPT
Two Consecutive Candles Alert - Toggle Alerts

🔹 Overview:
This indicator identifies when two consecutive candles of the same color appear on the chart—bullish (green) or bearish (red). It highlights the second candle of the streak and optionally triggers an alert, helping traders spot short-term momentum shifts or continuation patterns.
🔹 How It Works:
Candle Detection: The script checks the last three candles.
The second candle in a pair is marked only if it follows a candle of the same color and is not part of a longer streak.
Marking:
Bullish second candles are marked with a green triangle below the bar.
Bearish second candles are marked with a red triangle above the bar.
Alerts (Optional):
Traders can enable or disable alerts independently for bullish or bearish setups using checkboxes in the settings.
Alerts are triggered only on the second candle of a two-candle streak.
🔹 Inputs / Settings:
Enable Bullish Candle Alerts ✅
Enable Bearish Candle Alerts ✅
🔹 Use Case:
Identify short-term trend momentum.
Spot potential continuation setups after two consecutive candles of the same type.
Combine with other indicators for confirmation (e.g., support/resistance, moving averages).
🔹 Notes:
The indicator marks only the second candle in a two-candle streak to avoid marking longer streaks multiple times.
Alerts are fully optional and can be toggled on or off.
This indicator identifies when two consecutive candles of the same color appear on the chart—bullish (green) or bearish (red). It highlights the second candle of the streak and optionally triggers an alert, helping traders spot short-term momentum shifts or continuation patterns.
🔹 How It Works:
Candle Detection: The script checks the last three candles.
The second candle in a pair is marked only if it follows a candle of the same color and is not part of a longer streak.
Marking:
Bullish second candles are marked with a green triangle below the bar.
Bearish second candles are marked with a red triangle above the bar.
Alerts (Optional):
Traders can enable or disable alerts independently for bullish or bearish setups using checkboxes in the settings.
Alerts are triggered only on the second candle of a two-candle streak.
🔹 Inputs / Settings:
Enable Bullish Candle Alerts ✅
Enable Bearish Candle Alerts ✅
🔹 Use Case:
Identify short-term trend momentum.
Spot potential continuation setups after two consecutive candles of the same type.
Combine with other indicators for confirmation (e.g., support/resistance, moving averages).
🔹 Notes:
The indicator marks only the second candle in a two-candle streak to avoid marking longer streaks multiple times.
Alerts are fully optional and can be toggled on or off.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.