Illustrative Pattern Detector

Overview
This Pine Script v6 indicator visualizes a linear-regression channel and highlights potential consolidation zones using range, ATR, and volume criteria. It also computes an estimated up/down volume imbalance (derived from OHLC/volume, not tick-level order flow) to annotate zones with possible footprint markers. It’s intended for chart study and illustration.
How It Works
• Regression Channel: The midline uses ta.linreg over a user-selected lookback (default 100 bars). Upper/lower bands are ±(deviation × multiplier) using ta.stdev. Midline/bands can be colored by a simple trend heuristic (pivot highs/lows and recent slope).
• Consolidation Zones: A zone is “tight” when the price range over a window (default 20 bars) is small relative to ATR (multiplier 1.5) and the window’s average volume exceeds a longer lookback average (5× the box length, multiplier 1.5).
• Estimated Imbalance (Heuristic): Volume in each bar is apportioned to “up”/“down” using the bar’s position within its high-low range. The cumulative difference over the zone is compared to a threshold (default 2.0 × ATR × window). This is a proxy signal—not true bid/ask delta—and is used only to annotate zones that already meet the consolidation criteria.
Key Features
• Regression Channel: Midline with deviation bands; optional trend-based coloring.
• Consolidation Detection: Tight-range + elevated-volume zones using ATR and moving averages.
• Heuristic Footprint Markers: Optional labels when the estimated imbalance exceeds a user threshold.
• Customizable Visuals: Toggle channels, boxes, labels; choose colors and lookbacks.
What It Displays
The script overlays a regression channel and, when conditions are met, draws boxes around recent tight-range, higher-volume areas. If the heuristic imbalance exceeds the threshold, a label is added to the box for study purposes.
Originality
Built in Pine v6 using TradingView built-ins: ta.linreg, ta.stdev, ta.highest, ta.lowest, ta.atr, ta.sma.
Configuration Notes
Adjust channel lookback (default 100) and deviation multiplier (default 2.0). For zones, set the box length (default 20), ATR multiplier (1.5), volume multiplier (1.5), and imbalance threshold (2.0). Enable/disable labels and color modes as desired.
Important Notes
This indicator uses a heuristic approximation of imbalance from OHLC/volume and does not measure real order-flow or tick-by-tick delta. It is intended for educational/chart-illustration use only.
Legal Disclaimer
For informational and educational purposes only—not investment, financial, or trading advice. Past performance does not guarantee future results. Trading involves risk of loss. Provided “as is” without warranties. Consider consulting a qualified professional.
Skrypt tylko na zaproszenie
Tylko użytkownicy zatwierdzeni przez autora mogą uzyskać dostęp do tego skryptu. Musisz złożyć prośbę i uzyskać zgodę na jego użycie. Zazwyczaj jest ona udzielana po dokonaniu płatności. Aby uzyskać więcej informacji, postępuj zgodnie z instrukcjami autora poniżej lub skontaktuj się bezpośrednio z TradingScriptSolutions.
TradingView NIE zaleca płacenia za skrypt ani jego używania, jeśli nie masz pełnego zaufania do jego autora i nie rozumiesz, jak działa. Możesz także znaleźć darmowe, open-source'owe alternatywy w naszej sekcji skryptów społecznościowych.
Instrukcje autora
Wyłączenie odpowiedzialności
Skrypt tylko na zaproszenie
Tylko użytkownicy zatwierdzeni przez autora mogą uzyskać dostęp do tego skryptu. Musisz złożyć prośbę i uzyskać zgodę na jego użycie. Zazwyczaj jest ona udzielana po dokonaniu płatności. Aby uzyskać więcej informacji, postępuj zgodnie z instrukcjami autora poniżej lub skontaktuj się bezpośrednio z TradingScriptSolutions.
TradingView NIE zaleca płacenia za skrypt ani jego używania, jeśli nie masz pełnego zaufania do jego autora i nie rozumiesz, jak działa. Możesz także znaleźć darmowe, open-source'owe alternatywy w naszej sekcji skryptów społecznościowych.