Moving Average Ribbon
Apr 18, 2020

The Moving Average Ribbon indicator visualizes trend strength and potential reversals by plotting a series of up to 32 moving averages of varying lengths to create a fluid, ribbon-like structure on the price chart.
Usage
The Usage section describes how the script can be used to interpret market momentum and trend direction. Traders can utilize the ribbon in several ways:
- Trend Identification: When the moving averages are fanned out and moving in a consistent direction, it indicates a strong trend. The distance between the lines represents the strength of that trend.
- Trend Reversals: Price movements that break through the entire ribbon often signal a change in market direction.
- Crossovers: The interaction between the source price and the shortest moving average (MA 1) can trigger early entry or exit signals.
For example, a trader might overlay two ribbons with different settings to capture both short-term and long-term momentum. One ribbon could use a short base length (e.g., 1) to react quickly to price, while a second ribbon uses a longer base (e.g., 26) to identify the broader trend.
Details
The script constructs the ribbon by calculating a base length and incrementing it for each subsequent line. The total length for any given plot is determined by the formula: (Length * Start) + (Length * Plot Index). This allows for a geometric or linear expansion of the averages depending on the user's input.
The indicator supports three types of moving averages: Simple (SMA), Exponential (EMA), and Weighted (WMA). It includes a color calculation toggle that changes how the lines are colored: either based on the price relation to the individual MA or based on the MA's relation to the line immediately below it.
Settings
- Source: The price data used for MA calculations (default is Close).
- Type: Selects the moving average algorithm (SMA, EMA, or WMA).
- Theme: Choose between three preset color palettes for the ribbon display.
- Length: The multiplier used to determine the lookback period for each MA in the ribbon.
- Start: The starting plot number which defines the initial offset for the ribbon's calculation.
- No. of MAs: The total number of moving average lines to display, up to a maximum of 32.
- Colour option: When disabled, colors are based on price crossing the MA; when enabled, colors are based on the MA crossing the line below it.
FAQ
How do I adjust the ribbon for long-term trends? You can increase the "Length" and "Start" values. Note that if the resulting MA lengths exceed the platform's candle history (typically 5,000 bars), you may need to reduce the "No. of MAs" to avoid calculation errors.
What is the difference between the color options? The default setting colors the lines based on whether the price is above or below each specific MA. The secondary option colors the lines based on the relationship between adjacent MAs, which helps visualize internal ribbon crossovers.
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.
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.