All indicators

Machine Learning Regression Trend

By LuxAlgoAug 23, 2023

Static chart image

Machine Learning Regression Trend fits a linear regression channel the robust way: a RANSAC routine repeatedly samples the data, fits candidate lines, and keeps the model with the most inliers, so volatile spikes cannot drag the trend around. You get the familiar channel (support and resistance plus a forward projection) computed only from the observations that genuinely agree on a trend.

RANSAC works iteratively: select two random samples, fit a line, count how many points fall within the allowed error, save the model if inliers beat the threshold, and repeat until the iteration budget is spent. That inlier-first logic makes it deliberately conservative next to a plain least-squares fit that weighs every bar equally.

How to Trade the Machine Learning Regression Trend?

  • Channel rails: use the fitted channel as support and resistance, exactly as with a conventional regression channel, but with outliers excluded from the fit.
  • Red dots: detected outliers; the more that appear, the noisier the tracked trend, so treat channel touches with extra caution.
  • Blue margin: visualizes the allowed error band used to separate inliers from outliers.
  • Projection: the extended fit sketches where the robust trend points next.

Machine Learning Regression Trend Settings

  • Length: the linear regression's calculation window.
  • Width: the channel width of the linear regression.
  • Source: the input series used for the fit.
  • Minimum Inliers: how many inliers a candidate model needs to be considered valid.
  • Allowed Error: the tolerance for classifying inliers. "Auto" computes the threshold automatically, "Fixed" applies your own value.
  • Maximum Iterations Steps: caps the RANSAC iteration count.

Frequently Asked Questions

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5
Original indicatorBuilt in-house by LuxAlgo

The Library is free. Quant makes it yours.

Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.