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.
Script sur invitation seulement
Seuls les utilisateurs approuvés par l'auteur peuvent accéder à ce script. Vous devrez demander et obtenir l'autorisation pour l'utiliser. Celle-ci est généralement accordée après paiement. Pour plus de détails, suivez les instructions de l'auteur ci-dessous ou contactez directement TradingScriptSolutions.
TradingView ne recommande PAS de payer ou d'utiliser un script à moins que vous ne fassiez entièrement confiance à son auteur et que vous compreniez comment il fonctionne. Vous pouvez également trouver des alternatives gratuites et open-source dans nos scripts communautaires.
Instructions de l'auteur
Clause de non-responsabilité
Script sur invitation seulement
Seuls les utilisateurs approuvés par l'auteur peuvent accéder à ce script. Vous devrez demander et obtenir l'autorisation pour l'utiliser. Celle-ci est généralement accordée après paiement. Pour plus de détails, suivez les instructions de l'auteur ci-dessous ou contactez directement TradingScriptSolutions.
TradingView ne recommande PAS de payer ou d'utiliser un script à moins que vous ne fassiez entièrement confiance à son auteur et que vous compreniez comment il fonctionne. Vous pouvez également trouver des alternatives gratuites et open-source dans nos scripts communautaires.