Linear Regression Forecast

What Is the Linear Regression Forecast?

The Linear Regression Forecast (LRF) is based on the premise of linear regression, a statistical tool used to forecast stock price values using past values. LRF can be applied to determine the underlying trend and when prices are overextended to the upside or downside.

LRF uses the least squares method, a straight line plotted through prices that best fit the price data. This minimizes the distance between price and the resulting trendline. Instead of being plotted as a straight line, the LRF is a moving series that plots the forecasted value of the derived trend line for each data point. As a result, it follows the stock market like a moving average. The last point of the trendline is the forecasted value.

The Linear Regression Forecast Formula

We won't get into the details of the formula behind the LRF indicator. In a nutshell, the formula used to calculate LRF is based on the slope of a line: y = mx + b. You may remember this from high school algebra. The slope (m) and the intercept (b) values will find the best-fitting line.

Chart LRF With StockChartsACP

Adding the LRF indicator in StockChartsACP is a snap.

1— Enter the symbol for the stock, index, or exchange-traded fund you want to analyze.

2— From Chart Settings, scroll down the list of Standard Indicators.

3— Select Linear Regression Forecast.

Want to change the color, style, or any other indicator parameter? 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 LRF.

Colors. Choose the color for LRF 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.

The chart below shows an example of a StockChartsACP chart with the LRF indicator.



So, how can the LRF indicator help you invest or trade? The last point forecasts price direction. In the chart above, the short-term trend is up. If the stock price continues moving upward, you can add other indicators such as moving averages to confirm the trend’s strength and/or momentum. This can help you decide whether to buy, hold, or sell an asset.

Last updated