Rolling Trendline
By LuxAlgoFeb 17, 2026
Rolling Trendline is an indicator on Vela, our next-generation charting platform, written in Pine Script®.
Rolling Trendline maintains the trendline you would otherwise keep redrawing: it projects a slope forward on every bar and re-anchors only when price deviates beyond a standard-deviation threshold. ATR-based zones wrap the projection, turning one line into volatility-aware support and resistance that never needs manual updates.
The slope is a linear regression slope measured across a configurable lookback; each new bar extends the line by it, so the bias persists instead of reshaping bar by bar. When price proves the path wrong, a small circle and a break mark the reset, and the line re-anchors at current price with fresh slope and zone width.
How to Trade the Rolling Trendline?
- Green projection: upward slope, long bias. Pullbacks into the line or the lower ATR zone are the classic continuation entries, with stops beyond the outer band.
- Red projection: downward slope. Rallies into the line or upper zone frame short setups the same way.
- Reset circle: a re-anchor flags a possible regime shift; when the new slope agrees with a structural breakout, treat it as confirmation rather than noise.
- Zone width: each reset sets the band width from the ATR at that moment, and it stays constant until the next reset, so a wider or narrower zone after a reset shows whether volatility was higher or lower when the line re-anchored.
Rolling Trendline Settings
- Slope Lookback: history feeding the regression; higher is smoother, lower is more reactive.
- Deviation Multiplier: reset sensitivity. Higher values tolerate wider swings before recalibrating.
- Slope Divisor: flattens the projected slope, useful on violently volatile assets.
- Source (default Close): price input for the calculation.
- ATR Length / ATR Multiplier: how volatility is measured and how wide the zones draw.
- Colors and line width: visual styling for phases, zones, and the line.
Frequently Asked Questions
Free to use
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 10 Trendline 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.





