All indicators

Alma Moving Average Ribbon Reverse Length

Sep 19, 2021

Static chart image
SignalsMoving Averages

The Alma Moving Average Ribbon Reverse Length indicator generates a multi-layered ribbon of Arnaud Legoux Moving Averages (ALMA) using inverse golden ratio (phi) calculations to provide smooth, low-lag trend visualization and momentum analysis.

Usage

The Usage section describes how the script can be used to identify trend direction and strength through a dynamic ribbon interface. Users can monitor the expansion and contraction of the ribbon to gauge market volatility and potential reversal points.

  • Trend Identification: When the ribbon displays a bullish gradient (typically green), it indicates upward momentum. A bearish gradient (typically red) suggests downward momentum.
  • Automatic Scaling: The script only requires one main length input. It then automatically calculates the lengths of the remaining seven moving averages by dividing each subsequent length by the golden ratio (phi).
  • Crossings and Alerts: The tool includes a customizable alert system. Users can select specific moving average lines (e.g., #08 and #07) to monitor for "Over," "Under," or "All" crossing conditions.
  • Visual Signals: Optional plotshapes can be enabled to provide visual trend alerts directly on the chart, helping traders identify significant momentum shifts.

Details

The Arnaud Legoux Moving Average (ALMA) is designed to minimize lag while maintaining smoothness, making it superior to traditional EMAs or SMAs in trending markets. This specific implementation applies a "Reverse Length" logic where the primary user-defined length acts as the longest reference point.

The ribbon construction follows these mathematical steps:

  1. Window Calculation: The first MA uses the mainLen. Subsequent MAs are derived by the formula: $Length_{n} = \text{round}(Length_{n-1} / \phi)$, where $\phi \approx 1.618$.
  2. Gaussian Distribution: ALMA uses an offset (Gaussian) and sigma (standard deviation) to determine the weight distribution. The default offset of 0.85 and sigma of 6 are standard for balancing responsiveness and smoothness.
  3. Color Gradients: The script calculates the difference between adjacent moving averages to determine the gradient intensity. This provides a "heatmap" effect that reflects the strength of the trend relative to a defined centerline.

Settings

Source settings

  • Resolution: Sets a custom timeframe for the indicator data.
  • Allow Repainting: Toggles whether the security function allows repainting of data.
  • Main Source: Selects the input data (Close, Open, High, Low, etc.) for calculations.
  • Use log scale?: Applies a logarithmic transformation to the source data before calculating the MAs.

Length settings

  • Alma Main Length: Sets the starting period for the longest moving average in the ribbon.
  • Main Offset Alma: Adjusts the Gaussian distribution (0 to 1). Higher values align more closely with current price.
  • Main Sigma Alma: Controls the sharpness of the moving average curve.

Color options

  • Fill body of plots: Enables or disables the colored background between the moving average lines.
  • A/D Plots & Fill Gradients: These groups allow for granular control over the bullish/bearish colors, the centerline reference, and the number of steps in the color transition.

Alert Settings

  • Active Alerts: Master toggle for all alert logic.
  • Active Visual TrendAlerts: Displays shapes on the chart when trend conditions are met.
  • Offset For Visual Alerts: Shifts the visual markers horizontally for better visibility.
  • First/Second source signal: Defines which specific MA lines (#01-#08) are used to trigger crossing alerts.
  • Condition to activate alert: Specifies the crossover type (Over, Under, or All).

FAQ

How does the "Reverse Length" calculation work? The script takes your input length as the maximum value and uses the golden ratio to calculate smaller, faster moving averages that wrap around the price action more tightly than the primary length.

What is the significance of the Sigma setting? Sigma is used to give the ALMA its "sharpness." A value of 6 is standard; lowering it makes the average smoother, while raising it makes it more reactive to price spikes.

How do I access the Alma Moving Average Ribbon Reverse Length? 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.