All indicators

Linear Regression Fan

By LuxAlgoOct 11, 2021

Linear Regression Fan is an indicator on Vela, our next-generation charting platform, written in Pine Script®.

Linear Regression Fan anchors a fan of equidistant lines to a least-squares linear regression fit of price, spacing them by the fit's root-mean-square deviation multiplied by an adjustable factor. The rays originate at the regression's first point and extend to its most recent, a fit-driven relative of the classical fan principle, giving a trend graded internal levels instead of a single midline.

How to Trade the Linear Regression Fan?

  • Rays as sloped support and resistance: the equidistant lines mark graded reaction levels inside the move, from the fit outward.
  • Anchor at a pivot: place the Left Coordinate on the swing point that began the move, so the fit starts there. The fan then grades everything that followed.
  • Extremity breaks: when price escapes the outermost lines, the measure rule of broadening wedges can be applied to project take-profit and stop-loss levels.

Mult trades coverage for precision: a larger multiplier widens the fan to contain more of the action, while a smaller one tightens it so breaks register earlier. Lines Per Side adds intermediate rays when a denser ladder of levels helps.

Linear Regression Fan Settings

  • Left Coordinate / Right Coordinate: the start and end of the regression window, picked on the chart; place the left point on the pivot you care about.
  • Mult: multiplies the RMSD spacing, widening or narrowing the fan.
  • Lines Per Side: how many rays are drawn on each side of the fit.
  • Src: the price source the regression runs on.

Frequently Asked Questions

Free to use

Run it on Vela. Go further with a paid plan.

  • Up to 500 Custom Alerts, with webhook automation
  • Up to 10× the chart history of Free
  • Orderflow lookback up to full history
  • More Quant usage to customize it, plus extra usage when you need it
  • Futures data alongside crypto, stocks, forex and commodities
See plans

Also works on

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

Run it on Vela. Make it yours with Quant.

Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.