Moving Average Z-Score Suite
Jul 16, 2024

The Moving Average Z-Score Suite indicator transforms various moving average types into a normalized Z-Score oscillator to identify trend strength, overbought/oversold conditions, and potential reversals.
Usage
The Usage section describes how the script can be used to gauge market momentum and trend direction. The indicator provides a statistical perspective on price action by measuring how far a moving average deviates from its historical mean.
- Trend Identification: When the Z-Score crosses above zero, it suggests the price is above its mean, indicating a potential bullish trend. Conversely, a cross below zero suggests a bearish trend.
- Overbought/Oversold Conditions: Standard deviation levels (e.g., +2 and -2) act as markers for extreme price movements. Traders can use these levels to identify potential mean-reversion opportunities.
- Divergence Detection: The tool includes an optional feature to detect regular and hidden divergences between price and the Z-Score, signaling potential trend exhaustion or continuation.
- Candle Painting: Users can enable candle coloring to visually sync chart price action with the Z-Score trend state.
Details
The Z-Score is a statistical measurement representing a value's relationship to the mean of a group of values, expressed in standard deviations. This indicator applies this concept to moving averages, normalizing their values to make them comparable across different assets and timeframes.
The suite supports eleven distinct moving average types:
- Simple (SMA)
- Hull (HMA)
- Exponential (EMA)
- Weighted (WMA)
- Double Exponential (DEMA)
- Running (RMA)
- Linear Regression (LINREG)
- Triple Exponential (TEMA)
- Arnaud Legoux (ALMA)
- Kalman Hull (KHMA)
- T3 Moving Average
By converting these averages into a Z-Score, the script provides a quantifiable measure of trend persistence and volatility relative to the selected lookback period.
Settings
Calculation
- Moving Average Type: Selects the underlying moving average algorithm used for the Z-Score calculation.
- Calculation Source: Determines the price data (e.g., close, hl2) used for the moving average.
- Calculation Period: Sets the length of the selected moving average.
- Z-Score Lookback Period: Defines the window used to calculate the mean and standard deviation for normalization.
Extra Settings
- Sigma for ALMA: Adjusts the offset and smoothness specifically for the Arnaud Legoux Moving Average.
- Kalman Price Source: Specifies the source specifically for the Kalman filter logic.
- Measurement Noise: Controls the sensitivity of the Kalman filter to price changes.
- Process Noise: Adjusts the agility of the Kalman filter in following price trends.
UI Settings
- Show Standard Deviation Levels: Toggles the visibility of the 0, 1, 2, -1, and -2 horizontal levels.
- Show Extreme Levels: Displays filled regions for extreme Z-Score values (3 to 4 and -3 to -4).
- Paint Candles on Chart: Enables bar coloring based on the current Z-Score trend.
Divergences
- Show Detected Divergences: Toggles the calculation and plotting of divergence labels.
- Pivot Lookback Left/Right: Sets the number of bars required to confirm a pivot high or low for divergence detection.
FAQ
How do I interpret the Z-Score colors? The columns change color based on both the position relative to zero and the Rate of Change (RoC). A bright color indicates the Z-Score is moving away from zero (strengthening trend), while a faded color indicates it is returning toward zero (weakening momentum).
Which moving average should I choose? The choice depends on your strategy. SMAs provide stability, while HMAs or KALMAN-based averages offer reduced lag, making them more suitable for fast-moving markets.
How can I access the Moving Average Z-Score Suite? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Unlock Unlimited Access to the LuxAlgo Library
Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

