Linear Regression R2
Last updated
Last updated
Β© StockCharts.com, Inc. All Rights Reserved.
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.
The Linear Regression R2 (LR-R2) is a moving linear regression that plots the R-squared value of a linear regression over a specified time. 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.
Select Linear Regression R2 from the Standard Indicators list. The indicator will be plotted in a different panel (see chart below). The Linear Regression R2 oscillator in the daily chart of the SPDR S&P 500 ETF (SPY) is at 0.49, which means there's about 50% of 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.
To change the color, style, or other indicator parameter settings for LR-R2, select the settings icon next to the indicator and choose your parameters.
Periods. The default setting is 14, but you can change it to any number of bars you wish to use to calculate LRF.
Calculated From. There are various choices hereβsolid, solid (thin), solid (thick), dashed, etc. Take your pick. Select the value you want to use for calculations. This can be the open, high, low, close, (H + L)/2, (H + L + C)/3, (H + L + 2C)/4, (O + H + L + C)/4;
Line Style. You have a few choices hereβsolid, solid (thin), solid (thick), dashed, etc. Take your pick.
Opacity. Use the slider to select the transparency of LR-R2.
Colors. You can choose the color for LR-R2 that you prefer to view on your chart.
Add Overlays. Sometimes, additional overlays can help confirm trend direction. This dropdown menu offers several overlays to choose from.
LR-R2 can be used with indicators such as the Stochastic Oscillator or the Relative Strength Index (RSI). The chart below adds the Fast Stochastic Oscillator in a separate panel. On the chart, you see that between April 22 and May 1, 2024 the trend strength had declined from 0.8 to 0. After that decline, the LR-R2 started rising, and the %K line of the Fast Stochastic Oscillator crossed over the %D line. In addition, the Fast Stochastic Oscillator moved into overbought territory.
The Linear Regression Forecast indicator was overlaid on the price chart to add additional confirmation. Note that price crossed above the LRF. All three indicators confirm the start of an uptrend, which means you could potentially open a long position in SPY.