All indicators

Z-Score Buy and Sell Signals

Dec 24, 2022

Static chart image
SignalsOscillatorsVolatility

The Z-Score Buy and Sell Signals indicator identifies potential market reversals by analyzing price deviations from the mean relative to historical volatility.

Usage

The indicator can be used to identify extreme price movements and potential exhaustion points in any timeframe. Users can look for "Buy" and "Sell" labels which appear when the Z-score reaches its periodic lowest or highest points, respectively.

  • Reversal Signals: "Buy" labels appear at historical lows of the Z-score within the lookback period, suggesting a potential bounce. "Sell" labels appear at historical highs, suggesting a potential pullback.
  • Bar Coloring: The script highlights extreme statistical deviations directly on the price bars.
    • Green Bars: Indicate an oversold condition where the Z-score is less than or equal to -2 standard deviations.
    • Red Bars: Indicate an overbought condition where the Z-score is greater than or equal to 2 standard deviations.
  • Timeframe Optimization: For lower timeframes (e.g., 1-minute), a shorter length of 50–75 is often preferred. For higher timeframes (e.g., Daily), a longer lookback of 500–800 may be more appropriate for capturing significant cycle turns.

Details

The script calculates the Z-score by subtracting a Simple Moving Average (SMA) from the closing price and dividing the result by the Standard Deviation over the same user-defined period.

A Z-score represents how many standard deviations an element is from the mean. By tracking the highest and lowest Z-scores over the specified length, the tool detects when current price action has reached a statistical extreme compared to its recent history. A cooldown mechanism is implemented via a wait variable to prevent signal clustering and ensure labels are spaced appropriately for better readability.

Settings

  • Length: Determines the lookback period for the SMA, Standard Deviation, and the detection of historical Z-score extremes. Increasing this value makes the indicator less sensitive to minor price fluctuations.

FAQ

How do I access Z-Score Buy and Sell Signals?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Can this indicator be used for scalping?

Yes, by adjusting the "Length" setting to a lower value (e.g., 50), the indicator becomes more responsive to short-term volatility typical in scalping strategies.

Should I use this indicator alone?

It is recommended to use this tool as a supplementary indicator alongside support/resistance levels, trend lines, or other momentum oscillators to confirm reversal signals.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.