OPEN-SOURCE SCRIPT

Simple Gap Indicator

28
Title: Simple Gap Indicator

Description: This is a utility script designed to automate the tracking and management of price gaps (also known as "Windows") on the chart. Unlike static drawings, this indicator dynamically monitors open gaps and automatically "closes" them (stops drawing) once price has filled the area, keeping your chart clean and focused on active levels only.

Why Use This Tool? Traders often mark gaps manually, but charts quickly become cluttered with old, invalid levels. This script solves that problem by using an array-based management system to track every open gap in real-time and remove it the moment it is invalidated by price action.

Technical Methodology:

Gap Detection: The script identifies "Full Gaps" where the Low of the current candle is higher than the High of the previous candle (Bullish), or vice versa (Bearish). This indicates a total disconnect in price delivery.

Dynamic Filtering:

ATR Filter: Users can filter out insignificant "noise" gaps by setting a minimum size threshold based on the Average True Range (ATR).

Time Filter: Option to restrict gap detection to specific session hours (e.g., ignoring overnight gaps on 24h charts).

Auto-Closure: The script loops through all active gaps on every new bar. If the current price wick touches an open gap, the box is visually terminated at that specific bar index and removed from the tracking array.

Visuals:

Green Box: Bullish Gap (Support Zone).

Red Box: Bearish Gap (Resistance Zone).

Labels: Optional text displaying the precise Top/Bottom price coordinates of the gap.

How to Use:

Enable "Auto-Close Gap on Retest" to keep your chart clean.

Use the ATR Filter if you are getting too many signals on lower timeframes (e.g., set to 0.5x ATR).

Set alerts for "New Gap" or "Gap Filled" to automate your workflow.

Credits: Calculations based on standard Gap/Window price action theory. Array management logic custom-coded for Pine Script v6.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.