Overview
The Price Imbalance as Consecutive Levels of Averages indicator is an advanced technical analysis tool designed to identify and visualize price imbalances in financial markets. Unlike traditional moving average (MA) indicators that update continuously with each new price bar, this indicator employs moving averages calculated over consecutive, non-overlapping historical windows. This unique approach leverages comparative historical data to provide deeper insights into trend strength and potential reversals, offering traders a more nuanced understanding of market dynamics and reducing the likelihood of false signals or fakeouts.
Key Features
Consecutive Rolling Moving Averages: Utilizes three distinct simple moving averages (SMAs) calculated over consecutive, non-overlapping windows to capture different historical segments of price data.
Dynamic Color-Coded Visualization: SMA lines change color and style based on the relationship between the averages, highlighting both extreme and normal market conditions.
Median and Secondary Median Lines: Provides additional layers of price distribution insight during normal trend conditions through the plotting of primary and secondary median lines.
Fakeout Prevention: Filters out short-term volatility and sharp price movements by requiring consistent historical alignment of multiple moving averages.
Customizable Parameters: Offers flexibility to adjust SMA window lengths and line extensions to align with various trading strategies and timeframes.
Real-Time Updates with Historical Context: Continuously recalculates and updates SMA lines based on comparative historical windows, ensuring that the indicator reflects both current and past market conditions.
Inputs & Settings
Rolling Window Lengths:
Window 1 Length (Most Recent) Bars: Number of bars used to calculate the most recent SMA. (Default: 5, Range: 2–300)
Window 2 Length (Preceding) Bars: Number of bars for the second SMA, shifted by Window 1. (Default: 8, Range: 2–300)
Window 3 Length (Third Rolling) Bars: Number of bars for the third SMA, shifted by the combined lengths of Window 1 and Window 2. (Default: 13, Range: 2–300)
Horizontal Line Extension:
Horizontal Line Extension (Bars): Determines how far each SMA line extends horizontally on the chart. (Default: 10 bars, Range: 1–100)
Functionality and Theory
1. Calculating Consecutive Simple Moving Averages (SMAs):
The indicator calculates three SMAs, each based on distinct and consecutive historical windows of price data. This approach contrasts with traditional MAs that continuously update with each new price bar, offering a static view of past trends rather than an ongoing one.
Mean1 (SMA1): Calculated over the most recent Window 1 Length bars. Represents the short-term trend.
Mean1=∑i=1N1CloseiN1
Mean1=N1∑i=1N1Closei
Where N1N1 is the length of Window 1.
Mean2 (SMA2): Calculated over the preceding Window 2 Length bars, shifted back by Window 1 Length bars. Represents the medium-term trend.
\text{Mean2} = \frac{\sum_{i=1}^{N_2} \text{Close}_{i + N_1}}}{N_2}
Where N2N2 is the length of Window 2.
Mean3 (SMA3): Calculated over the third rolling Window 3 Length bars, shifted back by the combined lengths of Window 1 and Window 2 bars. Represents the long-term trend.
\text{Mean3} = \frac{\sum_{i=1}^{N_3} \text{Close}_{i + N_1 + N_2}}}{N_3}
Where N3N3 is the length of Window 3.
2. Determining Market Conditions:
The relationship between the three SMAs categorizes the market condition into either extreme or normal states, enabling traders to quickly assess trend strength and potential reversals.
Extreme Bullish:
Mean3<Mean2<Mean1
Mean3<Mean2<Mean1
Indicates a strong and sustained upward trend. SMA lines are colored gold and styled as dashed lines.
Extreme Bearish:
Mean3>Mean2>Mean1
Mean3>Mean2>Mean1
Indicates a strong and sustained downward trend. SMA lines are colored purple and styled as dashed lines.
Normal Bullish:
Mean1>Mean2andnot in extreme bullish condition
Mean1>Mean2andnot in extreme bullish condition
Indicates a standard upward trend. SMA lines are colored green and styled as solid lines.
Normal Bearish:
Mean1<Mean2andnot in extreme bearish condition
Mean1<Mean2andnot in extreme bearish condition
Indicates a standard downward trend. SMA lines are colored red and styled as solid lines.
3. Plotting Median and Secondary Median Lines:
During normal bullish or bearish conditions (green or red SMA lines), additional median lines are plotted to provide deeper insights into price distribution within the established SMA range.
Primary Median Line:
Calculated as the exact midpoint between Mean1 and Mean2.
Median=Mean1+Mean22
Median=2Mean1+Mean2
This line serves as a central reference point within the SMA range.
Secondary Median Lines:
These lines offer finer granularity by calculating the midpoints between the primary median and each of the two SMAs.
Secondary Median Upper=Median+Mean12
Secondary Median Upper=2Median+Mean1
Secondary Median Lower=Median+Mean22
Secondary Median Lower=2Median+Mean2
These secondary lines provide additional reference points, enhancing the trader's ability to identify optimal entry and exit levels within the SMA range.
Note: Median and secondary median lines are not displayed during extreme bullish or bearish conditions to maintain chart clarity and focus on the primary trend signals.
4. Fakeout Prevention:
The indicator's design inherently filters out short-term volatility and sharp price movements that often result in false signals or fakeouts. By requiring consistent historical alignment of three consecutive SMAs and incorporating median lines only during normal trend conditions, the indicator ensures that only sustained and genuine trend movements are highlighted. This layered approach enhances signal reliability, providing traders with greater confidence in their trading decisions.
Visual Representation
SMA Lines:
Mean1 (SMA1): Displayed prominently with a thicker line.
Mean2 (SMA2) and Mean3 (SMA3): Positioned sequentially behind Mean1, offering a layered view of different historical trends.
Color Coding:
Gold Dashed Lines: Extreme Bullish conditions.
Purple Dashed Lines: Extreme Bearish conditions.
Green Solid Lines: Normal Bullish conditions.
Red Solid Lines: Normal Bearish conditions.
Gray Lines: Represent Mean3 during normal conditions.
Median Lines:
Primary Median Line: Thin blue dotted line between Mean1 and Mean2.
Secondary Median Upper Line: Thin blue dashed line between Median and Mean1.
Secondary Median Lower Line: Thin blue dashed line between Median and Mean2.
Use Cases
Trend Confirmation:
Bullish Trends: When Mean1 and Mean2 are green, and SMAs align to confirm upward momentum.
Bearish Trends: When Mean1 and Mean2 are red, and SMAs align to confirm downward momentum.
Avoiding Fakeouts:
By filtering out inconsistent historical alignments and requiring consistent SMA relationships, traders can avoid acting on false breakout or breakdown signals caused by short-term volatility.
Support and Resistance Identification:
The SMA lines and median lines act as dynamic support and resistance levels, helping traders determine optimal entry and exit points based on historical price distributions.
Granular Price Analysis:
Secondary median lines provide finer insights into price distribution within the established SMA range, assisting in precise trade placement and risk management.
Combination with Other Indicators:
Enhances strategies when used alongside volume analysis, momentum indicators, or oscillators, providing a more comprehensive market view.
Theory Behind the Indicator
The Price Imbalance as Consecutive Levels of Averages indicator is grounded in the principle of moving averages smoothing out price data to reveal underlying trends. By utilizing three consecutive, non-overlapping SMAs, the indicator captures short-term, medium-term, and long-term historical price movements, offering a holistic view of the market's direction. This comparative historical analysis distinguishes it from traditional MAs, which continuously update and provide a more immediate, albeit sometimes superficial, trend indication.
The relationships between these SMAs serve as signals of trend strength and potential reversals:
Alignment Order: The sequence of SMAs (e.g., Mean1 above Mean2 above Mean3) indicates the dominance of certain trend phases, reflecting the market's momentum over different historical periods.
Color and Style Coding: Differentiates between extreme and normal conditions, allowing for quick visual assessment of market sentiment and trend strength.
Median Lines: Offer additional reference points within normal trend conditions, enhancing the ability to gauge price distribution and identify potential support/resistance levels.
This multi-layered approach ensures that traders receive nuanced information, enabling them to make strategic decisions based on both the strength and stability of trends, rather than solely relying on immediate price movements.
Mathematical Foundation
Simple Moving Average (SMA):
SMAN=∑i=1NCloseiN
SMAN=N∑i=1NClosei
Where NN is the number of periods (bars).
Median Calculation:
Median=Mean1+Mean22
Median=2Mean1+Mean2
Secondary Median Calculations:
Secondary Median Upper=Median+Mean12
Secondary Median Upper=2Median+Mean1
Secondary Median Lower=Median+Mean22
Secondary Median Lower=2Median+Mean2
Condition Logic:
Extreme Bullish:
Mean3<Mean2<Mean1
Mean3<Mean2<Mean1
Extreme Bearish:
Mean3>Mean2>Mean1
Mean3>Mean2>Mean1
Normal Bullish:
Mean1>Mean2andnot in Extreme Bullish
Mean1>Mean2andnot in Extreme Bullish
Normal Bearish:
Mean1<Mean2andnot in Extreme Bearish
Mean1<Mean2andnot in Extreme Bearish
Example Scenarios
1. Extreme Bullish Condition:
SMAs Alignment: Mean1 > Mean2 > Mean3
Visualization: All three SMAs are displayed as gold dashed lines.
Median Lines: Not displayed to maintain chart clarity.
Interpretation: Indicates a strong and sustained upward trend. Traders may consider entering long positions, confident in the trend's strength without the distraction of additional lines.
2. Normal Bullish Condition:
SMAs Alignment: Mean1 > Mean2 (not in extreme condition)
Visualization: Mean1 and Mean2 are green solid lines; Mean3 is gray.
Median Lines: A thin blue dotted median line is plotted between Mean1 and Mean2, with two additional thin blue dashed lines as secondary medians.
Interpretation: Confirms an upward trend while providing deeper insights into price distribution. Traders can use the median and secondary median lines to identify optimal entry points and manage risk more effectively.
3. Extreme Bearish Condition:
SMAs Alignment: Mean3 > Mean2 > Mean1
Visualization: All three SMAs are displayed as purple dashed lines.
Median Lines: Not displayed to maintain chart clarity.
Interpretation: Indicates a strong and sustained downward trend. Traders may consider entering short positions, confident in the trend's strength without the distraction of additional lines.
4. Normal Bearish Condition:
SMAs Alignment: Mean1 < Mean2 (not in extreme condition)
Visualization: Mean1 and Mean2 are red solid lines; Mean3 is gray.
Median Lines: A thin blue dotted median line is plotted between Mean1 and Mean2, with two additional thin blue dashed lines as secondary medians.
Interpretation: Confirms a downward trend while providing deeper insights into price distribution. Traders can use the median and secondary median lines to identify optimal entry points and manage risk more effectively.
Customization and Flexibility
The Price Imbalance as Consecutive Levels of Averages indicator is highly adaptable, allowing traders to tailor it to their specific trading styles and market conditions through adjustable parameters:
SMA Window Lengths: Modify the lengths of Window 1, Window 2, and Window 3 to capture different historical trend segments, whether focusing on short-term fluctuations or long-term movements.
Line Extension: Adjust the horizontal extension of SMA and median lines to align with different trading horizons and chart preferences.
Color and Style Preferences: While default colors and styles are optimized for clarity, traders can customize these elements to match their personal chart aesthetics and enhance visual differentiation.
This flexibility ensures that the indicator remains versatile and applicable across various markets, asset classes, and trading strategies, providing valuable insights tailored to individual trading needs.
Conclusion
The Price Imbalance as Consecutive Levels of Averages indicator offers a comprehensive and innovative approach to analyzing price trends and imbalances within financial markets. By utilizing three consecutive, non-overlapping SMAs and incorporating median lines during normal trend conditions, the indicator provides clear and actionable insights into trend strength and price distribution. Its unique design leverages comparative historical data, distinguishing it from traditional moving averages and enhancing its utility in identifying genuine market movements while minimizing false signals. This dynamic and customizable tool empowers traders to refine their technical analysis, optimize their trading strategies, and navigate the markets with greater confidence and precision.