Adaptive Volatility-Controlled LSMA
Oct 3, 2024

The Adaptive Volatility-Controlled LSMA indicator is a trend-following tool that combines the precision of Least Squares Moving Average (LSMA) with dynamic volatility filtering to identify market trends while minimizing noise.
Usage
The indicator can be used to identify trend direction and potential entry or exit points based on price interaction with volatility bands. A bullish trend is identified when the price closes above the upper volatility band and the LSMA is sloping upwards, while a bearish trend is identified when price closes below the lower band and the LSMA is sloping downwards.
Traders can use the LSMA line color and bar coloring to visually confirm the current trend. The volatility bands act as dynamic thresholds; price staying within the bands typically indicates a consolidating or ranging market, whereas a breakout beyond the bands suggests a significant directional move.
Details
The script is built upon two core technical components:
- Least Squares Moving Average (LSMA): Unlike traditional moving averages, the LSMA calculates a linear regression line over a specific period. This makes it more sensitive to recent price action and effectively reduces lag.
- ATR-Based Volatility Filtering: The script uses the Average True Range (ATR) to project bands around the LSMA. These bands expand during high volatility and contract during low volatility, creating an adaptive "noise filter."
- Trend Logic: A trend shift is confirmed only when price moves beyond these volatility-adjusted boundaries, ensuring that signals are generated by meaningful price momentum rather than minor fluctuations.
Settings
LSMA Settings
- LSMA Length: Determines the period used for the linear regression calculation. Higher values result in a smoother, slower-reacting line.
- LSMA Source: Sets the price source (Close, Open, High, Low, etc.) used for the calculation.
Volatility Filter
- ATR Length: Sets the lookback period for the Average True Range calculation.
- ATR Multiplier: Adjusts the width of the volatility bands. A higher multiplier requires more significant price movement to trigger a trend change.
Visual Settings
- LSMA Visual Settings: Allows customization of the LSMA line colors for uptrends and downtrends.
- Volatility Band Settings: Toggles the visibility of the bands and allows for color customization.
- Bar Coloring Settings: Enables or disables the coloring of price bars based on the detected trend.
FAQ
How do I access the Adaptive Volatility-Controlled LSMA?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What makes this different from a standard LSMA?
A standard LSMA only tracks the regression line. This tool adds an adaptive volatility envelope (ATR) to filter out false breakouts and "whipsaws" that often occur in choppy markets.
Can I use this for scalping or long-term investing?
Yes, the indicator is adaptive. By shortening the LSMA length and ATR multiplier, it can be tuned for fast-paced scalping, while increasing those values makes it suitable for long-term trend following.
Disclaimer
The Adaptive Volatility-Controlled LSMA is a tool to enhance market analysis. It should be used in conjunction with other analytical tools and should not be relied upon as the sole basis for trading or investment decisions.
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.

