Price Moving Average Ratio & Percentile
Jul 26, 2021

The Price Moving Average Ratio & Percentile indicator calculates the relationship between a source price and its moving average to identify potential accumulation zones and statistical extremes. It provides traders with a normalized view of price deviations, helping to determine if an asset is overextended or trading at historically significant value levels.
Usage
The Usage section describes how the script can be used to identify market conditions based on price-to-MA relationships.
- Price Moving Average Ratio (PMAR): This mode calculates the simple ratio of the price to its moving average. Traders typically use this as an accumulation signal generator. For example, setting an alert level below 1.0 (such as 0.7) can highlight periods where the asset is trading significantly below its average, often representing historical value zones.
- Price Moving Average Ratio Percentile (PMARP): This mode takes the PMAR and calculates its percentile rank over a specific lookback period. This provides a statistical measure (0-100) of how the current price deviation compares to historical data. A low PMARP suggests the price is "cheap" relative to its history over the lookback period.
- Signal Moving Average: An optional signal line can be applied to either the PMAR or PMARP plot to smooth the output and identify trend shifts in the ratio itself.
- Visual Alerts: The indicator includes background highlights and horizontal level lines to visually flag when the ratio or percentile crosses user-defined thresholds.
Details
The script offers several moving average types for the calculation, including SMA, EMA, HMA, RMA, and VWMA. The default settings (140-period VWMA on a daily timeframe) are designed to approximate a 20-week moving average, which is a common benchmark for long-term trend analysis.
The "Spectrum" color setting dynamically changes the plot color based on the current value. The "Blue Green Red" palette transitions through a full spectrum, while "Blue Red" provides a more direct contrast between extremes.
Settings
Main Properties
- Price source: The price value used for the calculation (default is Close).
- Indicator: Switches between displaying the PMAR (Ratio) or PMARP (Percentile).
- PMAR length: The period used to calculate the baseline moving average.
- MA type: The smoothing method for the baseline moving average.
Line Plot Settings
- Color type: Choose between a "Solid" color or a "Spectrum" that changes based on values.
- Spectrum: Selects the color palette (Blue Green Red or Blue Red).
- Solid color: The color used if "Solid" is selected.
- Line width: The thickness of the main indicator plot.
- Lookback: The number of bars used to calculate the percentile for the PMARP mode.
Signal MA Settings
- Signal MA: Enables or disables the additional signal moving average line.
- MA length: The period for the signal line.
- MA type: The smoothing method for the signal line.
- Color type / Spectrum / Solid color: Appearance settings for the signal line.
Visual Alert Level Settings
- Hi/Lo Alert levels: Thresholds for PMAR or PMARP that trigger visual signals.
- Signal Bars Transparency: Controls the opacity of the background highlight when alert levels are breached.
- Hi/Lo alert line: Toggles the visibility of horizontal threshold lines.
- Hi/Lo signal bars: Toggles the background coloring for alert conditions.
FAQ
How do I use this to find "bottoms"? Traders often look for PMAR values significantly below 1.0 or PMARP values near 1-5% to identify historical accumulation zones where price is exhausted to the downside.
What is the difference between PMAR and PMARP? PMAR is the raw ratio (Price / MA), whereas PMARP is the percentile rank of that ratio over time. PMARP is useful for normalizing data across different assets that may have different volatility profiles.
How can I access the Price Moving Average Ratio & Percentile? 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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.