ALMA Function - Arnaud Legoux Moving Average
May 21, 2020

The ALMA Function - Arnaud Legoux Moving Average indicator provides a highly responsive moving average calculation that utilizes a Gaussian distribution to reduce lag while maintaining superior smoothness for trend analysis.
Usage
The Usage section describes how the script can be used, providing a flexible alternative to standard moving averages for trend identification and signal generation.
Traders utilize the ALMA to identify the primary trend direction with minimal delay compared to Simple Moving Averages (SMA). For instance, a common application is to monitor price crossovers; when the price crosses above the ALMA line, it may signal an emerging bullish trend, whereas a cross below may indicate bearish momentum. Because this implementation supports series-based lengths, it can be used in advanced technical setups where the lookback period dynamically adjusts based on market volatility or other indicators.
Details
The ALMA calculation is based on a Gaussian filter shifted by an offset to regulate the trade-off between smoothness and lag. This specific implementation was developed to overcome limitations in built-in charting functions—specifically the inability to accept series-based variables for the length parameter.
The math involves calculating weights using a normalized Gaussian distribution:
- Offset (m): Determines the peak of the weight distribution within the window.
- Sigma (s): Controls the width or "tightness" of the Gaussian curve.
- Weighting: The function applies these weights to the price series to produce a value that is more representative of current price action without the typical noise found in standard averages.
This script also addresses a minor floor-logic discrepancy found in some built-in platform versions, ensuring the output adheres strictly to the original Arnaud Legoux mathematical design.
Settings
- ALMA Source: Determines the input data for the calculation, such as Close, Open, High, or Low.
- ALMA Length: Sets the window size for the calculation; higher values result in a smoother line with more lag.
- ALMA Sigma: Adjusts the standard deviation of the Gaussian distribution, impacting the sensitivity of the filter.
- ALMA Offset: Controls the weight distribution peak; a higher offset moves the weight closer to the most recent data to minimize lag.
FAQ
How does ALMA differ from an Exponential Moving Average (EMA)? Unlike the EMA which uses exponential decay, the ALMA uses a Gaussian distribution that can be shifted, allowing it to be more responsive to recent price changes while filtering out more market noise.
Can the length of this ALMA change dynamically? Yes, unlike standard built-in ALMA functions, this version is coded to allow for series-length inputs, making it compatible with adaptive trading systems.
How do I access the ALMA Function [FN]? 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.

