Higher High / Lower Low Probability IndicatorOverview
The "Higher High / Lower Low Probability Indicator" is an original statistical tool designed to help traders assess the likelihood of trend continuation in price action. By analyzing historical candles, it calculates the probability that the next candle will form a higher high (HH) or lower low (LL) based whether the previous candle expanded higher or lower.
This indicator uniquely incorporates handling for inside candles, where it falls back to the bias of the prior candle to maintain continuity in probability assessments. It's particularly useful for momentum traders, swing traders, or those incorporating probabilistic edges into their strategies, providing data-driven insights into potential bullish or bearish continuations without relying on complex oscillators or moving averages.
Features
Probability Calculations: Tracks occurrences and successes of higher highs and lower lows across the chart's history. For HH: If the previous candle had a higher high than the one before it, it computes the percentage chance the current candle will continue that pattern. The same logic applies to LL for downward trends.
Inside Candle Handling: Detects inside bars (where the high is lower and low is higher than the previous candle) and intelligently uses the bias from the candle before the inside bar, ensuring the indicator doesn't skip potential signals.
Visual Plotting: Displays the relevant probability (HH in green, LL in red) as a line plot only when the condition is met, helping users quickly identify active probabilities without clutter.
Informative Table: A customizable table in the chart shows HH and LL occurrences alongside their respective probabilities, formatted for easy reading.
User Inputs:
Table Position: Choose from options like "Top Right" (default), "Bottom Left", etc., to place the table where it suits your chart layout.
Text Size: Select from "Auto", "Tiny", "Small", "Normal" (default), or "Large" for optimal visibility.
All calculations are performed in real-time using Pine Script's historical data access, ensuring efficiency without repainting.
How to Use
Add the indicator to your chart via TradingView's indicator search.
Adjust the "Table Position" and "Text Size" inputs to fit your preferences.
Monitor the plotted probability line: Green indicates a potential HH continuation with the displayed percentage; red signals LL probability.
Refer to the table for cumulative stats—higher occurrences provide more reliable probabilities over time.
Combine with other tools like support/resistance levels or volume for confirmation. For example, a high HH probability (>70%) in an uptrend might signal a buy opportunity.
This indicator works on any timeframe and symbol but performs best on charts with sufficient historical data (e.g., daily or higher) to build meaningful statistics. Note that probabilities are historical and not predictive guarantees—always use risk management.
Limitations
Relies on available historical bars; on very short histories (e.g., new symbols), probabilities may start at 0% until patterns accumulate.
Does not account for external factors like news events or volatility spikes.
The table updates only on the last bar for performance reasons.
This script is open-source for community review and customization.
Pine Script® インジケーター






















