Recursive Least Squares Forecast
Feb 9, 2026

The Recursive Least Squares Forecast [LuxAlgo] is a professional-grade trading indicator built around an adaptive linear regression model that continuously learns from incoming price data. By updating its internal parameters on every new bar, this trading indicator dynamically estimates the current market equilibrium, projects future price direction using a forward-looking “Ghost Line,” and defines volatility-adjusted bands for identifying trend continuation and mean reversion opportunities.
Unlike traditional moving averages or static regression tools, this indicator adapts in real time to changing market conditions, making it suitable for both discretionary traders and systematic trading strategies that require responsiveness and low lag.
USAGE
The Recursive Least Squares Forecast trading indicator is designed to help traders identify trend direction, anticipate future price movement, and detect statistically meaningful market extremes. At its core is the RLS Mean line, which represents the adaptive equilibrium price estimated by the model. Surrounding this mean are dynamic bands that expand and contract with volatility, highlighting overextended conditions.
This indicator can be applied to multiple trading styles, including trend following and mean reversion strategies.
- Trend Following: Traders can analyze the slope and direction of the RLS Mean together with the projected Ghost Line to determine the prevailing market bias. A rising mean and upward projection suggest bullish conditions, while a declining structure signals bearish pressure.
- Mean Reversion: When price deviates significantly from the adaptive mean and reaches the outer bands, traders can prepare for potential reversion setups back toward equilibrium.
- Adaptive Responsiveness: The Forgetting Factor (λ) allows traders to fine-tune how quickly the model reacts to new information. Lower values (such as 0.95) prioritize recent price action and respond faster to pivots, while higher values (such as 0.99) emphasize stability and smoother trend estimation.
Mean Reversion Signals
The trading indicator includes a clear, rules-based framework for identifying mean reversion setups using its adaptive bands.
- Overextension Detection: A setup begins when price moves outside the Upper or Lower Band, signaling statistically overbought or oversold conditions relative to the current market regime.
- Entry Confirmation: A BUY or SELL signal is generated when price crosses back inside the band, indicating a potential return toward the RLS Mean.
- Profit Targeting: The RLS Mean line acts as the primary take-profit objective, representing the model’s estimate of fair value.
This approach allows traders to combine quantitative signals with discretionary confirmation, improving consistency in mean reversion trading strategies.
DETAILS
The Recursive Least Squares model assumes a linear price relationship defined by a slope and intercept that are updated recursively at every bar. The algorithm operates as an adaptive filter within a state-space framework, using a gain vector to optimally adjust its parameters as new data becomes available.
Compared to standard moving averages, the RLS algorithm minimizes cumulative squared prediction errors while assigning greater importance to recent observations. This results in a trading indicator that pivots quickly during regime shifts without introducing excessive lag or noise.
The Ghost Line extends the current RLS estimate into the future, offering a forward projection of the active trend. Accompanying this projection are Standard Deviation Forecast Bands, which visualize the expected range of future price movement based on the model’s current uncertainty. These forecast elements help traders anticipate where price is likely to move and where risk increases.
SETTINGS
- Forgetting Factor (λ): Determines how quickly older data is discounted. Higher values produce smoother, more stable estimates, while lower values increase sensitivity to recent price changes.
- Band Multiplier: Controls the width of the volatility-adjusted bands by scaling the standard deviation of the model’s forecast.
- Forecast Horizon: Sets the number of bars into the future used to project the Ghost Line and forecast bands.
- Show Ghost Line & Bands: Enables or disables the display of the forward projection and uncertainty bands.
- Show Mean Reversion Signals: Toggles the BUY and SELL labels used for mean reversion entries.
FAQ
What type of trading strategy is this indicator best suited for?
The Recursive Least Squares Forecast can be used for both trend following and mean reversion trading strategies, making it versatile across different market conditions.
Does this trading indicator repaint?
The model updates in real time with each new bar, but historical values are based on information available at that time, ensuring consistent and reliable analysis.
How do I access the Recursive Least Squares Forecast [LuxAlgo]?
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.comTradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, CoinAPI. CBOE BZX real-time US 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.

