Periodic Linear Regressions
By LuxAlgoSep 25, 2024
Periodic Linear Regressions fits a linear regression to price over each anchor period and resets when a new period begins: anchored calculation in the spirit of periodic VWAPs, applied to best-fit lines. Optional extremities scaled by the root mean squared error between price and the fit surround it with a linear regression channel, turning a slope estimate into usable support and resistance.
How to Trade the Periodic Linear Regressions?
- Slope color: with Bicolor enabled, green marks an upward fit and red a downward one, an immediate per-period regime read.
- Price at an extremity: the RMSE bands mark the channel's edges, most useful inside ranges and channels.
- Static line's angle: the straight fit shows how linear the period's trend has been and hints at its continuation.
- Anchor marks: flag where each new calculation period begins.
Two mechanical notes: a regression needs at least two points, so the static line cannot exist on a period's first bar and the rolling line starts plotting on the third; and the static line re-fits (and may repaint) until its period ends, while the rolling line extends from previously calculated points.
Periodic Linear Regressions Settings
- Method: "Static" draws the period's straight best-fit line; "Rolling" plots the evolving endpoint of successive fits.
- Anchor Type: "Periodic" resets each Anchor Period; "First Bar" runs one calculation from the start and works exclusively with Rolling.
- Anchor Period: the reset interval for periodic anchoring.
- Source: the input series being fitted.
- Multiple: scales the distance of the RMSE extremities.
- Show Extremities: toggles the upper and lower bands.
- Color, gradient (Rolling only), and dashboard location/size options handle presentation.
Frequently Asked Questions
Free on Vela
Run it on Vela. Go further with a paid plan.
- Up to 500 strategy 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
Also works on
Related indicators
All 8 Linear Regression indicatorsRun 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.




