PROTECTED SOURCE SCRIPT
Bullish & Bearish Gap Boxes with Gap Points 2025

Bullish & Bearish Gap Boxes with Gap Points & Table Functionality 2025
## **1. Highlighted Key Points in the Code**
* **Gap Detection Logic**
* **Bullish Gap:** `Low >= High[1]` (low is above the previous high) → bullish sentiment.
* **Bearish Gap:** `High <= Low[1]` (high is below the previous low) → bearish sentiment.
* **Configurable Filters**
* Minimum gap size in points (`minGapPoints`).
* Option to show/hide bullish and bearish gaps individually.
* Custom table position, row count, and text size for flexibility.
* **Visual Marking on Chart**
* **Boxes:** Drawn between gap high and low, extending to the right until price “fills” the gap.
* **Labels:** Show gap size (points + %), tooltip with exact high & low.
* **Automatic Gap Removal**
* Bullish gap deleted when `Low <= gapBottom` (gap filled).
* Bearish gap deleted when `High >= gapTop` (gap filled).
* **Gap Ranking Table**
* Shows **nearest** gaps to the current price, sorted by distance.
* Separate bear and bull gap lists, each limited to `maxBearRows` & `maxBullRows`.
* Displays type, gap size, gap %, high, and low.
* Uses the current chart timeframe in the title.
* **Multi-Timeframe Safe Handling**
* Uses `request.security()` to fetch OHLC for the active timeframe.
* Includes a function to translate timeframe into human-readable labels.
---
## **2. User Functionality**
From a trader’s perspective, here’s what your script allows:
Setting window divided into Two Parts for Better Handling normal & Table Section
✅ Functionality to Hide and Show_Gap_Tbl.
✅ **Detects and visually marks price gaps** automatically on any timeframe.
✅ **Extends gap zones** forward until price fills them.
✅ **Separates bullish and bearish gaps** for better decision-making.
✅ **Custom filtering** (minimum size, display toggles, table layout).
✅ **Gap watchlist table** showing only the nearest & most relevant gaps to current price.
✅ **Multi-timeframe compatibility** without repainting issues.
✅ **Clean chart control** with `max_labels_count` & `max_lines_count` limits to prevent overload.
✅ **Clean Tooltip control** with `Gap High` & `Gap Low` & Gap Range Points for Quick Understanding.
---
## **3. Why Gaps Are Important in Trading (Runaway vs. Normal Gaps)**
Gaps in price are **areas with no trading activity** between two consecutive bars. They represent **imbalances between supply and demand** and often occur due to overnight news, earnings, or strong market sentiment.
### **A. Normal (Common) Gaps**
* Appear in normal market moves.
* Often get “filled” quickly as price reverts to the mean.
* Not usually linked to major trends.
* Example: A small gap on a 5-min chart due to sudden but minor news.
### **B. Runaway (Continuation) Gaps**
* Happen **in the middle of strong trends** (uptrend or downtrend).
* Indicate **momentum acceleration** — institutions are aggressively entering.
* Rarely get filled in the short term.
* Example: During a bull rally, price gaps up and never comes back to retest.
---
### **Why Traders Watch Gaps**
1. **Support & Resistance Zones**
* Gaps act like **magnets** for price (gap fill targets) or **barriers** (price rejection).
2. **Trend Confirmation**
* Runaway gaps signal strong momentum; traders may enter in the direction of the gap.
3. **Trade Setup Opportunities**
* Fade the gap: Trade against it if expecting a fill.
* Follow the gap: Trade with it if expecting continuation.
4. **Volume Confirmation**
* High volume + gap = institutional activity → higher reliability.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.