OPEN-SOURCE SCRIPT

LiquidityPulse Higher Timeframe Consecutive Candle Run Levels

48
LiquidityPulse Higher Timeframe Consecutive Candle Run Levels

Research suggests that financial markets can alternate between trend-persistence and mean-reversion regimes, particularly at short (intraday) or very long timeframes. Extended directional moves, whether prolonged intraday rallies or sell-offs, also carry a statistically higher chance of retracing or reversing (Safari & Schmidhuber, 2025). In addition, studies examining support and resistance behaviour show that swing highs or lows formed after strong directional moves may act as structurally and psychologically important price levels, where subsequent price interactions have an increased likelihood of stalling or bouncing rather than passing through directly (Chung & Bellotti, 2021). By highlighting higher-timeframe candle runs and marking their extremal levels, this indicator aims to display areas where directional momentum previously stopped, providing contextual "watch levels" that traders may incorporate into their broader analysis.

How this information is used in the indicator:
When a sequence of consecutive higher-timeframe candles prints in the same direction, the indicator highlights the lower-timeframe chart with a green or red background, depending on whether the higher-timeframe run was bullish or bearish. The highest high (for a bull run) or lowest low (for a bear run) of that sequence forms a recent extremum, and this value is plotted as a swing-high or swing-low level. These levels appear only after the required number of consecutive higher-timeframe candles (set by the user) have closed, and they continue updating as long as the higher-timeframe streak remains intact. A level "freezes" and stops updating only when an opposite-colour higher-timeframe candle closes (e.g., a red candle ending a bull run, or a green candle ending a bear run). Once frozen, the level remains fixed to preserve that structural information for future analysis or retests. The number of past bull/bear levels displayed on the chart is also adjustable in the settings.

Why capture a level after a long directional run:
When price moves in one direction for several consecutive candles (e.g. 4, 5, or more), it reflects strong directional bias, often associated with momentum, liquidity imbalance, or liquidity grabs. Once that sequence breaks, the final level reached marks a point of exhaustion or structural resistance/support, where that bias failed to continue. These inflection points are often used by traders and trading algorithms to assess potential reversals, retests, or breakout setups. By freezing these levels once the run ends, the indicator creates a map of historically significant price zones, allowing traders to observe how price behaves around them over time.

Additional information displayed by the indicator:
Each detected run includes a label showing the run length (the number of consecutive higher-timeframe candles in the streak) along with the source timeframe used for detection. The indicator also displays an overstretch marker: this numerical value appears when the total size of the candle bodies within the run exceeds a user-defined multiple of the average higher-timeframe body size (default: 1.5x). This helps highlight runs that were unusually strong or extended relative to typical volatility. You can also enable alerts that trigger when this overstretch ratio exceeds a higher threshold.

Key Settings
Timeframe: Choose which HTF to analyse (e.g., 15m, 1h, 4h)
Minimum Candle Run Length: Define how many consecutive candles are needed to trigger a level (e.g., 4)
Overstretch Settings: Customize detection threshold and alert trigger (in multiples of average body size)
Background Tints: Enable/disable visual highlights for bull and bear runs
Display Capacity: Choose how many past bull/bear levels to show

How Traders Can Use This Indicator
Traders can:
-Watch levels for retests, reversals, breakouts, or consolidation
-Identify areas where price showed strong directional conviction
-Spot extended or aggressive moves based on overstretch detection
-Monitor how price reacts when retesting prior run levels
-Build confluence with your existing levels, zones, or indicators

Disclaimer
This tool does not reflect true order flow, liquidity, or institutional positioning. It is a visual aid that highlights specific candle behaviour patterns and does not produce predictive signals. All analysis is subject to interpretation, and past price behaviour does not imply future outcomes.

References:
Trends and Reversion in Financial Markets on Time Scales from Minutes to Decades (Sara A. Safari & Christof Schmidhuber, 2025)
Evidence and Behaviour of Support and Resistance Levels in Financial Time Series (Chung & Bellotti, 2021)

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.