PROTECTED SOURCE SCRIPT
Consecutive Close Scanner

Overview
Continuous Close Scanner (CCS) highlights and quantifies runs of consecutive bullish or bearish closes. The indicator draws boxes around qualifying runs (configurable minimum consecutive closes), optionally displays the percent move for each run, counts run starts inside a configurable lookback window, and can show the immediate reverse move until two confirming bars on the opposite side.
Key features
• Detects runs of N consecutive closes (input Consecutive bars).
• Shades active runs with colored boxes and optionally prints percent move.
• Counts how many qualifying runs started within the lookback window (table).
• Optional reverse-move tracker: shows live and final reverse move after a run ends (stops when two confirming opposite closes occur).
• Configurable colors, transparency, table position, and lookback.
• Built in safeguards for TradingView limits (box/label caps configured).
How it works (brief)
When the number of consecutive bullish (close>open) or bearish (close<open) bars reaches the minRun threshold, a box is created covering that run’s high/low. The script computes the run’s percentage move (low→high for bullish, high→low for bearish) and places a label in the visually emptiest spot inside the box. The lookback window controls the counting and culling of historical labels to avoid platform overload.
Inputs
Direction: Bullish / Bearish / Both
Consecutive bars (minRun) — integer ≥3
Lookback bars — window for counting and visuals (respect platform limits)
Colors & transparency for bullish / bearish boxes
Show: Info table, Percentages on chart, Reverse move tracking, Table position
Important notes & limitations
• Uses boxes and labels; TradingView has element limits (max 500). If you use large lookbacks or many markets, you may hit limits — lower lookback or disable persistent labels.
• On TradingView Free plans keep lookback ≤ 4999 to reduce risk of platform; paid accounts can use all the way to 9999 bars lookback.
• Percent calculations are price-based from run extremes; small/near-zero prices can produce large percentages — interpret accordingly.
• Designed as a visual/analytical tool — not a signal generator.
Disclaimer
This script is provided for educational/analytical use only. It is not financial advice. Use at your own risk.
Continuous Close Scanner (CCS) highlights and quantifies runs of consecutive bullish or bearish closes. The indicator draws boxes around qualifying runs (configurable minimum consecutive closes), optionally displays the percent move for each run, counts run starts inside a configurable lookback window, and can show the immediate reverse move until two confirming bars on the opposite side.
Key features
• Detects runs of N consecutive closes (input Consecutive bars).
• Shades active runs with colored boxes and optionally prints percent move.
• Counts how many qualifying runs started within the lookback window (table).
• Optional reverse-move tracker: shows live and final reverse move after a run ends (stops when two confirming opposite closes occur).
• Configurable colors, transparency, table position, and lookback.
• Built in safeguards for TradingView limits (box/label caps configured).
How it works (brief)
When the number of consecutive bullish (close>open) or bearish (close<open) bars reaches the minRun threshold, a box is created covering that run’s high/low. The script computes the run’s percentage move (low→high for bullish, high→low for bearish) and places a label in the visually emptiest spot inside the box. The lookback window controls the counting and culling of historical labels to avoid platform overload.
Inputs
Direction: Bullish / Bearish / Both
Consecutive bars (minRun) — integer ≥3
Lookback bars — window for counting and visuals (respect platform limits)
Colors & transparency for bullish / bearish boxes
Show: Info table, Percentages on chart, Reverse move tracking, Table position
Important notes & limitations
• Uses boxes and labels; TradingView has element limits (max 500). If you use large lookbacks or many markets, you may hit limits — lower lookback or disable persistent labels.
• On TradingView Free plans keep lookback ≤ 4999 to reduce risk of platform; paid accounts can use all the way to 9999 bars lookback.
• Percent calculations are price-based from run extremes; small/near-zero prices can produce large percentages — interpret accordingly.
• Designed as a visual/analytical tool — not a signal generator.
Disclaimer
This script is provided for educational/analytical use only. It is not financial advice. Use at your own risk.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.