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.
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.

