All indicators

Percentage Distance From Moving Average

Dec 27, 2020

Static chart image
SignalsOscillatorsMoving Averages

The Percentage Distance From Moving Average indicator measures the real-time percentage deviation of an asset's price from a user-defined simple moving average to identify overextended or mean-reverting market conditions.

Usage

The Usage section describes how the script can be used to identify trend strength and potential exhaustion points. Traders typically use this tool to visualize how far price has "stretched" away from its average value.

  • Trend Identification: When the oscillator is above 0, the price is trading above the moving average, indicating a bullish trend. When below 0, the price is trading below the moving average, indicating a bearish trend.
  • Mean Reversion: Extremely high or low values may suggest the price is overextended and could return toward the moving average.
  • Crossovers: A move across the zero line signifies a price crossover with the moving average, which is often used as a basic trend-following signal.

Details

The script calculates the distance between the current closing price and a Simple Moving Average (SMA) of a specified length. The result is expressed as a percentage of the moving average value using the formula: ((Price - MA) / MA) * 100.

Unlike many standard distance oscillators that utilize Exponential Moving Averages (EMA), this tool defaults to a Simple Moving Average (SMA) to provide a more traditional baseline for price action analysis. The visual output changes color dynamically based on whether the percentage difference is positive (bullish) or negative (bearish), allowing for quick trend assessment.

Settings

  • MA Length: Determines the lookback period for the Simple Moving Average. A higher value (e.g., 200) tracks long-term trends, while a lower value (e.g., 20) is more sensitive to short-term price fluctuations.

FAQ

How do I interpret a 0 value on the indicator? A value of 0 indicates that the current price is exactly equal to the Simple Moving Average, representing a point of equilibrium.

Can I use this for identifying overbought or oversold levels? Yes, by observing historical peaks and troughs on a specific asset, you can identify horizontal levels where the price historically tends to reverse or consolidate back toward the mean.

How can I access the Percentage Distance From Moving Average? 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.