Price Moving Average Ratio & Percentile

Jul 26, 2021

Static chart image
Oscillators
Moving Averages

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 access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

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.