Interpolated Median Volatility LSMA
Jun 1, 2025

The Interpolated Median Volatility LSMA indicator combines trend-following and volatility analysis by applying percentile-based linear interpolation to the Least Squares Moving Average (LSMA) and standard deviation to produce a smoothed, noise-resistant trend signal.
Usage
The Usage section describes how the script can be used to identify trend direction and potential breakout points.
- Trend Identification: The indicator features a colored LSMA line and shaded volatility bands. When the price is above the upper band, the signal turns bullish (green), indicating a potential long entry. When the price falls below the lower band, the signal turns bearish (red/purple), indicating a potential short entry.
- Volatility Bands: Unlike standard Bollinger Bands, these bands use interpolated median values, making them less reactive to extreme outliers while remaining adaptive to structural shifts in market volatility.
- Bar Coloring: The script automatically colors the price bars or candles to match the current signal state, providing immediate visual feedback on the prevailing trend.
Details
This tool builds upon the Least Squares Moving Average (LSMA), which uses linear regression to calculate a moving average that is more reactive than simple or exponential averages. To enhance this further, the script incorporates:
- Percentile Linear Interpolation: Instead of using raw LSMA or Standard Deviation values, it calculates the 50th percentile (median) over a specific lookback period. This interpolation smooths the data by estimating values between data points, effectively filtering out market noise.
- Adaptive Volatility: The width of the bands is determined by the interpolated standard deviation multiplied by a user-defined factor. This ensures the bands expand and contract based on normalized volatility rather than single-bar spikes.
Settings
- Source: The price data point (e.g., Close, HL2) used for all calculations.
- LSMA Length: The lookback period for the initial Least Squares Moving Average calculation.
- SD Length: The period used to calculate the raw standard deviation (volatility).
- Percentile Length: The window used for the linear interpolation of the median values for both the LSMA and standard deviation.
- Multiplier: Adjusts the width of the volatility bands; higher values require more significant price moves to trigger a signal.
FAQ
How do I use the signals from this indicator?
A long signal is triggered when the close price crosses above the upper band, while a short signal is triggered when the close price crosses below the lower band.
Can I set alerts for trend changes?
Yes, the script includes alert conditions for long entries, short entries, and general state changes, allowing you to be notified when the price breaks through the volatility bands.
How can I access Interpolated Median Volatility LSMA?
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.

