All indicators

Moving Average Shift

Mar 10, 2025

Static chart image
SignalsOscillatorsCandlestickMoving Averages

The Moving Average Shift indicator provides a comprehensive framework for visualizing trend direction and identifying potential mean reversion points through a combination of customizable moving averages and a specialized shift oscillator. It helps traders distinguish between trending price action and extreme deviations that may lead to price corrections.

Usage

The indicator can be used for both trend following and mean reversion trading. By observing the price relative to the selected Moving Average, traders can establish the primary trend bias.

  • Trend Identification: Candles are dynamically colored based on whether the price is above or below the chosen Moving Average. This provides an immediate visual cue for the current market trend.
  • Mean Reversion: The MA Shift Oscillator measures the normalized difference between price and the Moving Average. When the oscillator reaches extreme levels and begins to turn back toward the zero line, it identifies potential mean reversion opportunities.
  • Filtering Signals: Use the threshold setting to filter out small price fluctuations. Diamond signals appear on the chart when the oscillator crosses its previous values while outside these thresholds, highlighting significant shifts in momentum.
  • Momentum States: The oscillator features four distinct colors representing its state:
    • Strong Bullish: Above 0 and increasing.
    • Weakening Bullish: Above 0 and decreasing.
    • Strong Bearish: Below 0 and decreasing.
    • Weakening Bearish: Below 0 and increasing.

Details

The script calculates the difference between the source price and a selected moving average type. To ensure the oscillator remains relevant across different assets and timeframes, it normalizes this difference using a linear interpolation of the 99th percentile of recent deviations. The resulting value is smoothed using a Hull Moving Average (HMA) applied to the change in the normalized deviation. This process creates a responsive yet smooth oscillator that highlights when price has stretched too far from its mean.

Settings

MA

  • Type: Select the calculation method for the moving average (SMA, EMA, SMMA, WMA, or VWMA).
  • Length: Sets the lookback period for the primary moving average.
  • Source: Determines the price data used for the MA calculation (e.g., Close, HL2).

MA Shift Oscillator

  • Length: Controls the smoothing period for the shift oscillator.
  • Threshold: Defines the boundary for mean reversion signals; higher values produce fewer, more significant signals.
  • ⯁ (Show Signals): Toggles the display of diamond signals on the chart.

Color

  • Oscillator Colors: Customizable inputs for the four momentum states described in the usage section.

FAQ

How do I use the diamond signals?

The diamond signals represent potential mean reversion points where the price is significantly extended from the moving average and starting to return. These are often used as entry points for counter-trend trades or exit points for trend-following positions.

Can I change the moving average type?

Yes, the indicator supports five different types of moving averages: Simple (SMA), Exponential (EMA), Smoothed (SMMA/RMA), Weighted (WMA), and Volume Weighted (VWMA).

How can I access the Moving Average Shift?

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

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.