Alma Moving Average Ribbon Reverse Length
Sep 19, 2021

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

