Linear Regression Channel / Curve / Slope
Price has a direction — this shows you how far it has strayed from it.
The Linear Regression Channel (LɪɴRᴇɢ) fits a least-squares regression line to price over a defined period and builds a statistically grounded channel around it using standard deviation bands. Two independent channels can be displayed simultaneously — the second optionally scaled to a higher timeframe — giving both short-term and broader structural context on a single chart.
1st & 2nd Linear Regression Channels
Each channel consists of a central regression line — the best-fit line through price over the selected bar count — flanked by up to three configurable standard deviation bands above and below. Band levels, colors, line styles, and widths are independently adjustable for each channel.
Optional trend coloring switches the channel to green or red based on the slope direction, making trend bias immediately visible without reading the labels.
Level labels display at the right edge of each band, optionally showing the exact price alongside the standard deviation level. A configurable offset shifts labels further right for clarity, with a connecting arrow line drawn automatically when the offset is large enough.
2nd Channel — Higher Timeframe Extension
The second channel can be extended to a user-defined higher timeframe (1H, 4H, or 1D), effectively scaling the bar count by the ratio between the selected timeframe and the current chart timeframe. This allows a single count value to represent the same structural lookback regardless of the active timeframe. A display shortening option limits the visible portion to keep the chart readable when the extended length is very large.
Linear Regression Curve
A bar-by-bar rolling linear regression plot — the classic ta.linreg curve — drawn continuously across the chart rather than as a fixed channel. Optional standard deviation or ATR bands wrap the curve, providing a dynamic envelope that adapts to recent volatility. Useful for tracking the current regression value in real time rather than reading a fixed endpoint.
Linear Regression Slope
A plotarrow-based slope indicator derived from the correlation between price and bar index, scaled by their respective standard deviations. Upward arrows indicate positive slope momentum, downward arrows indicate negative. Useful as a quick directional filter without adding visual clutter.
Volume / Volatility AddOns
Three overlays complement the regression framework with volume and volatility context.
Volume Weighted Colored Bars color each bar relative to a volume moving average using Fibonacci-derived thresholds — deep green and dark red for high-conviction bars above 1.618× average, aqua and orange for low-participation bars below 0.618×.
Sign of Exhaustion flags bars where volume exceeds a configurable multiple of the average (default 4.669×), marking potential climactic or exhaustion moves with a visual marker above the bar.
High Volatility detection flags bars whose range exceeds ATR × a configurable multiplier (default 2.718×), identifying abnormally expanded bars that may signal breakouts or reversals.
Alerts
Built-in alerts fire when price crosses the regression base line or any standard deviation band of either channel, when the 1st channel base line crosses any band of the 2nd channel, and when volume spikes or high volatility conditions are detected.