Linear Regression R2
What Is the Linear Regression R2 Indicator?
The Linear Regression R2 (LR-R2 indicator uses linear regression techniques to determine how closely price data adheres to a trend line. In other words, it determines whether a security is trending or not.

It is primarily used to decide whether to trade at all. If you're a trend trader, you want to trade when price is trending. If you prefer to get in and out of trades more frequently than a trend trader, you'd prefer to trade in a non-trending market.
Calculating LR-R2
Linear Regression R2 is based on a linear regression (line of best fit), and determines how closely individual data points on a price chart follow that straight line. The exact formula of linear regression is beyond the scope of this article, but after the linear regression is calculated, the rest of the formula is simpler.
The first step is to take all the data points in the specified lookback period, and determine the linear regression value based on that data. Next, average the data points in that lookback period. Both the linear regression value and the average price for each data point will be used in the calculation of LR-R2.
It compares the amount of deviation from the regression line to the amount of deviation from the average price over the timeframe, in order to determine how much of the total variation in price can be explained by the fact that the price action is following a trend.
Interpreting LR-R2
The interpretation of the Linear Regression R2 indicator is very straightforward. It's an oscillator that moves between zero and one. When it's at zero, it indicates a lack of trend and when it's at one, it indicates a strong trend.
Identifying Strong Trends
LR-R2 values near 1.0 indicate price action that follows a very straight line.
The chart below shows Raytheon (RTX) in a somewhat messy uptrend from early June to August, followed by a steep linear downtrend from August to October. Note that LR-R2 is at or near the top of its range for most of that downtrend, because the price bars are in such a straight line. The uptrend, on the other hand, is full of pullbacks, trading ranges, and gaps up. The LR-R2 reflects this, with a much choppier line that peaks short of the top and drops multiple times over the length of the uptrend.

Note that the LR-R2 value is high even in a downtrend. This indicator does not measure the direction of the trend - only whether the security is trending or not.
Identifying Trading Ranges
An LR-R2 value near 0.0 indicates a lack of trend, usually appearing when a security is in a sideways trading range.
The chart below shows Blackrock (BLK) dropping from its high in early September and then flattening out by the end of the month. The strong downward trend resulted in LR-R2 values near 1.0 for several days, but they quickly dropped to near zero as price flattened out.

Identifying Weak Trends
The previous examples covered LR-R2 values at either extreme, but what do values in the middle of the range indicate? If the value is around 0.5, it means there's about a 50% chance the price action is based on a linear relationship and a 50% chance that price action is related to events such as interest rate changes, inflation fears, or general economic fundamentals. It's a tossup whether the LR-R2 value means an emerging or weakening trend, or just choppy price action.
The chart below shows Oracle (ORCL) with a sharp rise in late July and early August, followed by extremely messy price movement from August through October. The LR-R2 line moves around a lot, but struggles to rise above the midpoint of 0.5. A case could be made for a downtrend emerging after the high in early September, but it is certainly not a strong trend. These LR-R2 values are more likely attributable to choppy price action.

The Bottom Line
Linear Regression R2 is a straightforward indicator to quickly check whether or not a security is trending. A value closer to 1.0 indicates a strong trend, and a value closer to 0.0 indicates a lack of trend. The indicator does not show the direction of the trend - only the trend's existence, and to some extent, its strength. As with all indicators, it should be used in conjunction with other technical analysis tools.
Charting with LR-R2
Using with StockChartsACP
This indicator can be added from the Chart Settings panel for your StockChartsACP chart. The indicator can be positioned above, below, or behind the security's price plot.

Click here for a live version of this chart.
By default, the indicator looks back 14 periods for its calculations. This parameter can be adjusted to meet your technical analysis needs. A larger number of periods will result in a smoother indicator line.
Last updated
Was this helpful?

