All indicators

Scripting Tutorial 8 - Triple Many Moving Averages Ribbons

Oct 16, 2019

Static chart image
Dynamic OverlaysSupport and ResistanceSignalsForecastingMoving Averages

The Triple Many Moving Averages indicator provides a comprehensive trend-following toolkit featuring three highly customizable moving averages with integrated multi-timeframe support, predictive forecasting, and aesthetic ribbon gradients.

Usage

The Usage section describes how the script can be used to identify trends and potential reversals. Users can plot up to three independent moving averages (MAs), each with its own specific calculation method (SMA, EMA, WMA, etc.) and time resolution.

Key applications include:

  • Trend Identification: Use the three MAs to determine short, medium, and long-term market direction.
  • Crossover Analysis: The script automatically identifies and labels crossovers on the chart (e.g., a "Golden Cross" or "Death Cross") providing specific details on which periods intersected.
  • Dynamic Support/Resistance: The visual ribbons between the MAs act as dynamic zones of interest. These ribbons are alpha-color coded to reflect the trend's strength and orientation.
  • Predictive Forecasting: The indicator projects MA values five periods into the future. Users can adjust the "Forecast Bias" (Bullish, Bearish, or Neutral) to see how the MAs might react to specific anticipated price movements.

Details

The script is constructed using a modular approach to handle various calculation types and multi-timeframe requests via request.security().

  • Ribbon Logic: Ribbons are generated by calculating intermediate MA periods between the main user-defined inputs. For example, if MA1 is 50 and MA2 is 100, the script calculates five steps in between. Note that ribbons only appear if the connected MAs share the same Type, Resolution, and Source to ensure mathematical consistency.
  • Forecasting Algorithm: The forecast function estimates future values by extending the current MA calculation logic while incorporating an ATR-based bias. This allows traders to visualize the "path of least resistance" for the average based on current volatility.
  • Customization: Each MA can be toggled on or off. If an MA is disabled, its associated crossovers and forecasts are automatically hidden to maintain chart clarity.

Settings

Moving Average Settings (MA1, MA2, MA3)

  • Period: The lookback length for the calculation.
  • Type: Select between SMA, EMA, WMA, RMA, HMA, DEMA, TEMA, or VWMA.
  • Source: The price data used for calculation (e.g., Close, Open, HL2).
  • Resolution: Determines the timeframe of the MA, allowing for multi-timeframe analysis on a single chart.
  • Visible: Toggles the visibility of the specific MA line and its related crossovers.

Forecast & Visuals

  • Show Crosses: Enables or disables the labels that appear when MAs intersect.
  • Forecast Bias: Adjusts the projected direction (Neutral, Bullish, Bearish) for the forecast plots.
  • Forecast Bias Period: Sets the lookback for the ATR used in bias magnitude.
  • Forecast Bias Magnitude: Determines how aggressively the forecast reacts to the selected bias.
  • Show Forecasts: Toggles the future-projected circles on the chart.
  • Show Ribbons: Toggles the gradient fill between the different moving average levels.

FAQ

How do I enable ribbons between different MA types? Ribbons are designed to only appear when both MAs share the same "Type", "Resolution", and "Source". If these settings differ, the ribbons will remain hidden to prevent misleading visual data.

What does the Forecast Bias do? The Forecast Bias uses the Average True Range (ATR) to simulate potential future price movement. A "Bullish" bias assumes price will move up by the ATR magnitude, showing you how quickly the MA would react to such a move.

How can I access the Triple Many Moving Averages? 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.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.