OPEN-SOURCE SCRIPT
Full Candle Higher/Lower (No Repeats)

🔎 What the Script Does (Pine Script v6)
Keeps track of the last signal
Uses a persistent variable lastSignal (initialized once as "none").
Ensures that if a signal repeats consecutively, it won’t be triggered again.
Defines the conditions for a “Higher” or “Lower” candle sequence
Higher condition:
Current close > previous high, AND previous low ≤ the high of two bars ago.
→ This means the candle has fully broken higher.
Lower condition:
Current close < previous low, AND previous high ≥ the low of two bars ago.
→ This means the candle has fully broken lower.
Checks for new signals only
If a candle meets the condition and the last signal wasn’t the same, a new signal is triggered.
Updates lastSignal to prevent repeats.
Plots labels/arrows
A “Higher” signal shows a green label below the bar.
A “Lower” signal shows a red label above the bar.
Sets alerts
So you can be notified in TradingView whenever a “Higher” or “Lower” flag is detected.
📊 Trading Logic in Words
The indicator is looking for full candle breakouts.
If a candle closes above the previous high (with some confirmation from older bars), it flags it as a “Higher” signal.
If a candle closes below the previous low (with similar confirmation), it flags it as a “Lower” signal.
It avoids duplicate consecutive signals by remembering what the last one was.
✅ Why It’s Useful
Helps traders spot momentum continuation candles (strong push candles).
Reduces noise by not repeating the same signal multiple times in a row.
Works like a breakout detector that tells you when the market is making a new leg up or new leg down.
Keeps track of the last signal
Uses a persistent variable lastSignal (initialized once as "none").
Ensures that if a signal repeats consecutively, it won’t be triggered again.
Defines the conditions for a “Higher” or “Lower” candle sequence
Higher condition:
Current close > previous high, AND previous low ≤ the high of two bars ago.
→ This means the candle has fully broken higher.
Lower condition:
Current close < previous low, AND previous high ≥ the low of two bars ago.
→ This means the candle has fully broken lower.
Checks for new signals only
If a candle meets the condition and the last signal wasn’t the same, a new signal is triggered.
Updates lastSignal to prevent repeats.
Plots labels/arrows
A “Higher” signal shows a green label below the bar.
A “Lower” signal shows a red label above the bar.
Sets alerts
So you can be notified in TradingView whenever a “Higher” or “Lower” flag is detected.
📊 Trading Logic in Words
The indicator is looking for full candle breakouts.
If a candle closes above the previous high (with some confirmation from older bars), it flags it as a “Higher” signal.
If a candle closes below the previous low (with similar confirmation), it flags it as a “Lower” signal.
It avoids duplicate consecutive signals by remembering what the last one was.
✅ Why It’s Useful
Helps traders spot momentum continuation candles (strong push candles).
Reduces noise by not repeating the same signal multiple times in a row.
Works like a breakout detector that tells you when the market is making a new leg up or new leg down.
Скрипт с открытым кодом
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.
Скрипт с открытым кодом
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.