PROTECTED SOURCE SCRIPT
Gap Detector

Gap Detector Indicator
The Gap Detector designed to identify price gaps on a chart, highlighting significant upward and downward gaps based on user-defined thresholds. It visually marks these gaps for easy identification and generates alerts when a gap occurs.
Features
- Customizable Gap Size: Users can define the minimum gap size required for detection.
- Delay Functionality: A user-defined number of bars to wait before confirming and signaling a gap.
- Visual Gap Highlighting: Clearly displays detected gaps as colored boxes on the chart.
- Instant Alerts: Provides alerts immediately after the specified delay, notifying users of the detected gap.
Settings
- Min Gap Size (price points):
- Defines the minimum price difference between consecutive bars required to recognize a gap.
- Default value: `1.0`
- Bars to wait after gap:
- Determines the delay in bars before confirming a detected gap.
- Default value: `2`
How it Works
Gap Detection Logic:
- Gap Up: Identified when the low price of the current bar is higher than the high price of the previous bar, exceeding the minimum gap size.
- Gap Down: Identified when the high price of the current bar is lower than the low price of the previous bar, again exceeding the minimum gap size.
Gap Confirmation and Visualization:
- After detecting a gap, the indicator waits the specified number of bars before confirming.
- Once confirmed, it visually highlights the gap area on the chart:
- Gap Up: Highlighted with a green box.
- Gap Down: Highlighted with a red box.
Alerts:
- Generates clear alerts with descriptive messages:
- Gap direction (Up or Down).
- Gap size in price points.
- Number of bars elapsed since gap detection.
Alert Conditions
- Gap Up Confirmed: Alerts when a gap up is confirmed.
- Gap Down Confirmed: Alerts when a gap down is confirmed.
The Gap Detector designed to identify price gaps on a chart, highlighting significant upward and downward gaps based on user-defined thresholds. It visually marks these gaps for easy identification and generates alerts when a gap occurs.
Features
- Customizable Gap Size: Users can define the minimum gap size required for detection.
- Delay Functionality: A user-defined number of bars to wait before confirming and signaling a gap.
- Visual Gap Highlighting: Clearly displays detected gaps as colored boxes on the chart.
- Instant Alerts: Provides alerts immediately after the specified delay, notifying users of the detected gap.
Settings
- Min Gap Size (price points):
- Defines the minimum price difference between consecutive bars required to recognize a gap.
- Default value: `1.0`
- Bars to wait after gap:
- Determines the delay in bars before confirming a detected gap.
- Default value: `2`
How it Works
Gap Detection Logic:
- Gap Up: Identified when the low price of the current bar is higher than the high price of the previous bar, exceeding the minimum gap size.
- Gap Down: Identified when the high price of the current bar is lower than the low price of the previous bar, again exceeding the minimum gap size.
Gap Confirmation and Visualization:
- After detecting a gap, the indicator waits the specified number of bars before confirming.
- Once confirmed, it visually highlights the gap area on the chart:
- Gap Up: Highlighted with a green box.
- Gap Down: Highlighted with a red box.
Alerts:
- Generates clear alerts with descriptive messages:
- Gap direction (Up or Down).
- Gap size in price points.
- Number of bars elapsed since gap detection.
Alert Conditions
- Gap Up Confirmed: Alerts when a gap up is confirmed.
- Gap Down Confirmed: Alerts when a gap down is confirmed.
Script protégé
Ce script est publié en source fermée. Toutefois, vous pouvez l'utiliser librement et sans aucune restriction - en savoir plus ici.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script protégé
Ce script est publié en source fermée. Toutefois, vous pouvez l'utiliser librement et sans aucune restriction - en savoir plus ici.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.