What is Linear Regression Slope?
Linear Regression Slope fits a straight line through the last 14 closes by least squares and plots that line's slope in its own pane. The value is the price change per bar that the fitted line implies. Above zero the line is rising, below zero falling, and the further from zero the steeper it is. A dashed zero line marks the boundary.
Linear Regression Slope reports the direction and speed of the fit. It does not say how well the line fits the closes, it is not comparable between markets with different prices, and it does not predict where the line goes next.
How to use Linear Regression Slope
- Sign. Positive means the best-fit line through the window is rising, negative that it is falling.
- Size. The value is in price units per bar, so a reading of 50 on BTC/USDT means the fit rises by about 50 per bar.
- Crossing zero. A move through zero means the fitted line has gone from rising to falling, or the reverse, over the window.
- Shrinking slope. A slope that stays positive but gets smaller means the fitted rise is slowing.
These are ways to read the line, not entry signals on their own.
Settings
| Setting | Default | What it changes |
|---|---|---|
| Length | 14 | Bars the line is fitted through. Lower reacts faster and is noisier; higher is smoother and later. Minimum 2. |
| Source | Close | Which price each bar contributes. Open, high, low and the averaged sources such as hl2 and hlc3 are also available. |
Adjust the window length and price source in the indicator settings.
Calculation
Each bar, a least-squares line is fitted through the window, with bar position on one axis and price on the other. The slope is calculated from each value's distance to the window's mean:
t = bar position, 0 for the oldest bar to 13 for the newest
p = price of that bar
slope = sum of (t - mean t) * (p - mean p)
/ sum of (t - mean t)^2
This gives the same result as the textbook formula built from raw sums, but working from distances to the mean keeps it accurate on high-priced markets, where the raw form subtracts very large numbers from each other.
The line starts once the window holds a full 14 bars. The dashed zero line is drawn by Altrady Charts as a reference; the indicator itself defines no levels.
Limitations
- It is in price units. The reading scales with price, so it cannot be compared between markets, or across a long history of one market whose price has changed a lot.
- It does not show fit quality. A steep slope through scattered prices and one through a clean trend can be the same number. The Trend Strength Index asks how straight the move was.
- It lags. The fit weighs every bar in the window, so a turn takes several bars to show up as a change in slope.
- Outliers pull it. A single large bar near either end of the window tilts the fitted line noticeably.
- The live candle moves. The current bar's value changes until that bar closes.
Frequently asked questions
Linear Regression Slope is the slope of the least-squares straight line through the last 14 closes, expressed as price change per bar. It turns the direction and steepness of recent price into a single number.
Above zero the fitted trend is rising, below zero falling. Larger values mean a steeper fit. Because it is in price units, read it against its own recent history on the same market and timeframe rather than against a fixed number.
Both come from the same fitted line. The Least Squares Moving Average plots where the line ends, which is a price level. Linear Regression Slope plots how steep the line is. Standard Error measures how far the closes scatter around it.
Yes. The indicator declares two inputs: Length, default 14 with a minimum of 2, and Source, default close. Open the indicator's settings on the chart to change them. Source accepts any of the available prices, including open, high, low, hl2 and hlc3.
No. Each value is calculated from a fixed window of the latest bars, so closed bars are never revised and loading older history does not change them. The current candle's value moves while it is live and settles when it closes.
Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Linear Regression Slope already applied. On any other market, open the indicator picker on the chart and choose Linear Regression Slope from the Trend group.