Moving Average Ribbon
Oct 21, 2016

The Moving Average Ribbon indicator provides a comprehensive visual representation of market momentum and trend strength by plotting a sequence of twenty moving averages with varying periodicities. By observing the expansion, contraction, and sequencing of these averages, traders can identify trend transitions, potential support/resistance zones, and periods of high or low volatility.
Usage
The Usage section describes how the script can be used to interpret market trends and momentum. The indicator is primarily used to identify the direction and strength of a trend based on the alignment of the moving averages.
- Trend Identification: When the shorter-term moving averages are above the longer-term ones and fanning out, it indicates a strong bullish trend. Conversely, when shorter-term averages are below the longer-term ones, a bearish trend is confirmed.
- Momentum Changes: A "squeeze" or narrowing of the ribbon suggests a potential trend reversal or a transition into a consolidation phase.
- Dynamic Support/Resistance: During established trends, the ribbon often acts as a dynamic zone where price may find support (in an uptrend) or resistance (in a downtrend).
The script includes built-in color-coding logic to enhance interpretation:
- Bright Green/Red: Indicates strong directional momentum where price action and the relationship between fast and slow averages are aligned.
- Faded Green/Red: Indicates potential weakening in momentum or a retracement within the broader trend.
Details
The Moving Average Ribbon is an evolution of the Madrid Moving Average Ribbon, refactored for improved performance and versatility. It calculates 20 different moving averages ranging from a period of 5 to 100, typically in increments of 5.
A key feature of this implementation is the flexibility of the calculation engine. Unlike standard ribbons that often restrict users to Simple (SMA) or Exponential (EMA) averages, this tool supports eight different types of moving averages. This allows traders to choose between more reactive averages, like the Hull Moving Average (HMA), or more stable ones, like the Triangular Moving Average (TRIMA).
The logic also includes alert conditions triggered when the fastest average (5-period) crosses the slowest average (100-period), signaling a primary trend shift.
Settings
- Source: Determines the price data used for the moving average calculations (e.g., Close, Open, HL2).
- MA Type: Allows the user to select the specific calculation method for all lines in the ribbon. Options include:
- sma: Simple Moving Average.
- ema: Exponential Moving Average.
- wma: Weighted Moving Average.
- trima: Triangular Moving Average.
- zlema: Zero-Lag Exponential Moving Average.
- dema: Double Exponential Moving Average.
- tema: Triple Exponential Moving Average.
- hma: Hull Moving Average.
FAQ
How do I interpret the colors of the ribbon? The colors change based on the slope of the individual moving averages and their position relative to the 100-period baseline. Bright colors indicate strong trend alignment, while transparent/faded colors suggest a divergence between the short-term slope and long-term trend.
Can I set alerts for trend changes? Yes, the script is optimized for alerts and will trigger a notification when the 5-period moving average crosses over or under the 100-period moving average.
How can I access the Moving Average Ribbon? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Unlock Unlimited Access to the LuxAlgo Library
Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.
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.

