All indicators

Adaptive Volatility-Controlled LSMA

Oct 3, 2024

Static chart image
SignalsChannelsMoving AveragesVolatility

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.

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.