Rate of Change w/ Moving Average
Jun 7, 2019

The Rate of Change w/ Moving Average indicator calculates the percentage difference between the current price and a previous price point while overlaying a smoothed simple moving average to identify momentum shifts and trend direction. This tool enhances the standard ROC by filtering noise through a secondary trend line and using a dynamic color-coded system to signal changes in momentum velocity and direction.
Usage
The Usage section describes how the script can be used. Traders utilize this indicator to identify overextended price movements, trend reversals, and momentum Exhaustion.
- Zero Line Crosses: When the ROC crosses above the zero line, it indicates a shift to positive momentum; crossing below indicates a shift to negative momentum.
- ROC/Signal Crossovers: The relationship between the ROC line and its Simple Moving Average (SMA) acts as a trigger. For example, the ROC crossing above its SMA can suggest a bullish acceleration.
- Color Analysis: The indicator employs a multi-state coloring logic based on the slope of both the ROC and its SMA. Bright green suggests strong bullish momentum where both the value and its slope are increasing, while deep red suggests strong bearish momentum. Teal, fuchsia, and orange indicate various stages of momentum deceleration or counter-trend movement.
Details
The script calculates the "difabs" (absolute difference) as a percentage: ((Current - Previous) / Previous) * 100. This value is then smoothed using a Simple Moving Average (SMA) of a user-defined length.
A unique feature of this implementation is the slope calculation for both the raw ROC and the smoothed ROC. By comparing the current value to the previous value, the script determines if momentum is accelerating or decelerating. This logic is then mapped to the visual output, allowing traders to see not just the direction of price change, but the "speed" at which that change is occurring relative to its recent average.
Settings
- Length: The lookback period used to calculate the percentage price change (ROC).
- SMA Length: The number of bars used to calculate the Simple Moving Average of the ROC line.
- Source: The price data point used for calculations (e.g., Close, Open, High, Low).
FAQ
How do I interpret the different colors on the ROC line? The colors represent the relationship between the ROC value, its SMA, and their respective slopes. Green indicates the ROC is above the SMA and rising, while red indicates it is below the SMA and falling. Other colors like teal or orange represent transitional phases where the ROC and its trend line are diverging.
What is the significance of the zero line? The zero line represents the point where the current price is equal to the price from the specified lookback length. Values above zero indicate an uptrend over that period, while values below zero indicate a downtrend.
How can I access the Rate of Change w/ 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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.