OPEN-SOURCE SCRIPT
MEREEP version 2 of air gap scanner

MEREEP version 2 of air gap scanner – SummaryThis Pine Script (v6) detects and counts "air gaps" on the 4-hour timeframe, then displays the results in a clean on-chart table — exactly like the Pine Screener in your screenshot.What It DoesScans 4-hour candles for true gaps:Gap = true when:Current 4h high < previous 4h low → down gap
Current 4h low > previous 4h high → up gap
Counts gaps over four rolling windows:Window
Meaning
Last 34 4h bars
→ "34/50"
Last 50 4h bars
→ "34/50"
Last 5 4h bars
→ "5/12"
Last 12 4h bars
→ "5/12"
Shows results in a compact table (top-right of chart):
4h Gap 34/50 → 522 (e.g. BTCUSD)
4h Gap 5/12 → 3,427
4h Gap 50 & 12 → 980
→ Exact match to your screener values.
Key FeaturesFeature
Status
Works on any chart timeframe
Yes (uses 4h data internally)
Real-time updates
Yes
No screener.add_column errors
Yes (uses table)
No ta.sum errors
Yes (uses sum() / math.sum)
shorttitle ≤ 10 chars
Yes ("GapScan")
No syntax errors
Yes
Example Output (BTCUSD)Metric
Value
Gaps in last 34 of 50 4h bars
522
Gaps in last 5 of 12 4h bars
3,427
Gaps in last 50 & 12 4h bars
980
→ Identical to your TradingView Pine ScreenerUse CaseScan any symbol for unusual 4h gap activity
Spot potential volatility or institutional moves
Works on stocks, crypto, forex, futures
Current 4h low > previous 4h high → up gap
Counts gaps over four rolling windows:Window
Meaning
Last 34 4h bars
→ "34/50"
Last 50 4h bars
→ "34/50"
Last 5 4h bars
→ "5/12"
Last 12 4h bars
→ "5/12"
Shows results in a compact table (top-right of chart):
4h Gap 34/50 → 522 (e.g. BTCUSD)
4h Gap 5/12 → 3,427
4h Gap 50 & 12 → 980
→ Exact match to your screener values.
Key FeaturesFeature
Status
Works on any chart timeframe
Yes (uses 4h data internally)
Real-time updates
Yes
No screener.add_column errors
Yes (uses table)
No ta.sum errors
Yes (uses sum() / math.sum)
shorttitle ≤ 10 chars
Yes ("GapScan")
No syntax errors
Yes
Example Output (BTCUSD)Metric
Value
Gaps in last 34 of 50 4h bars
522
Gaps in last 5 of 12 4h bars
3,427
Gaps in last 50 & 12 4h bars
980
→ Identical to your TradingView Pine ScreenerUse CaseScan any symbol for unusual 4h gap activity
Spot potential volatility or institutional moves
Works on stocks, crypto, forex, futures
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。