Prices go up Friday 27 Nov · 00:00 New York 5d 00:34:00

Open-source

Regression Slope Oscillator

The Regression Slope Oscillator is a trend–momentum tool that applies multiple linear regression slope calculations over different lookback ranges, then av...

Regression Slope Oscillator preview
Published Jan 19, 2026
3,39250,247

What this TradingView script does

The Regression Slope Oscillator is a trend–momentum tool that applies multiple linear regression slope calculations over different lookback ranges, then averages them into a single oscillator line. This design helps traders visualize when price is extending beyond typical regression behavior, as well as when momentum is shifting up or down.

🔵 CONCEPTS

- Regression Slope – Measures the steepness and direction of price trends over a selected length.

f_log_regression(src, length) => float sumX = 0.0 float sumY = 0.0 float sumXSqr = 0.0 float sumXY = 0.0

for i = 0 to length - 1 val = math.log(src) per = i + 1.0 sumX += per sumY += val sumXSqr += per * per sumXY += val * per

slope = (length * sumXY - sumX * sumY) / (length * sumXSqr - sumX * sumX)

slope*-1

- Multi–Sample Averaging – Instead of relying on one regression slope, the indicator loops through many lengths (from Min Range to Max Range with Step increments) and averages their slopes.

multiSlope(length)=> // Get regression slope slope = f_log_regression(close, length) slopAvg.push(slope)

for i = minRange to maxRange by step multiSlope(i)

How traders can use it

Use Regression Slope Oscillator as a chart context layer inside TradingView: read the structure it highlights, compare it with your market bias, and let the script narrow which moves deserve attention.

The strongest workflow is to combine the script with higher timeframe structure, volume context, and a repeatable execution plan instead of treating any single label as a standalone trade.

Ready to level up your trading?

Get advanced indicators, backtesting and the BigBeluga community in one plan.

Get Access