Linear Regression Forecast

The Linear Regression Forecast indicators performs regression analysis on optionally smoothed price data, forecasts the regression lines if desired, and creates standard deviation bands above and below the regression line. First, the data, based on the price selected, is smoothed using the moving average period and type. If you prefer no smoothing, choose a period of 1. The resulting data is used to form regression lines ending at each bar, using the regression period specified. The values at each bar can optionally be forecasted values, determined by projecting the regression lines X bars into the future, X being the forecast period. If X=0, then no forecasting will occur. Standard deviation bands can then be drawn above and below the regression line, based on a number of standard deviations (standard deviation multiple) specified, and a standard deviation value computed using data in the the regression period range.

The name of this indicator understates its capabilities; forecasting is optional and is but a small part of what this indicator can do. In its most basic form, with no smoothing (period of 1) and no forecasting (forecast period of 0), LRF simply gives the ending point of linear regression lines ending at each bar using the regression period provided. These settings produce a moving average identical to the Least Squares moving average type available in Investor/RT (add both to your chart and see).

A smoothing period causes the data to be pre-smoothed prior to performing regression analysis or forecasting. A forecast period takes the linear regression line ending at each point, and projects it forward X number of bars, X being the forecast period. This projected value is then used as the LRF value for that bar.

The bands that are drawn use a standard deviation that changes over time. The standard deviations are computed just as they are for the Linear Regression study. The standard deviation multiplier specified in the preferences is multiplied by the standard deviation value to determine how far the bands will be drawn from the base line.

The Linear Regression Oscillator represents the number of standard deviations of current price from the linear regression line. A value of 2 means that price is currently 2 standard deviations above the linear regression line (using the regression period specified...ending on that bar). A value of -1.5 means price is currently 1 1/2 standard deviations below the regression line. This options has been added as a "Linear Regression Oscillator" check box to the LRF indicator. When drawn, reference lines are automatically drawn at -2, -1, 0, 1, and 2 standard deviations. It is recommended that the Linear Regression Oscillator be drawn in a separate window pane from price data. The Linear Regression Oscillator tells how far the current price has deviated from the regression trendline, in units of standard deviations, or how far the price has deviated from the general trend established by the regression analysis (using period specified).

See Also:

Presentation

lrf

Above is a Daily Candlestick Chart of an Intel Corporation (INTC). The Linear Regression Forecast (LRF) is drawn in black, with an upper 2 standard deviation band drawn in blue, and a lower band drawn in red.

Formula

Keyboard Adjustment

The periods involved in the LRF indicator can be adjusted directly from the keyboard without opening up the preference window. First, select the indicator, then use the up and down arrow keys to adjust the regression period up or down by 1. To adjust the MA period, hold down the shift-key while hitting the up and down arrows. To adjust the forecast period, hold down the ctrl-key while hitting the up and down arrow keys.

lrfPrefs

  • Price -Price data to be used in computation.
  • MA Type -Type of smoothing to be applied prior to regression.
  • MA Period -Smoothing period to be used prior to regression.
  • Regression Period -Number of bars to be used in computing the regression line.
  • Forecast Period -The middle regression band can optionally be forecast into the future by a user specified number of bars. If the forecast period is 0, no forecasting will occur. If the forecast period is greater than 0, then the linear regression line (computed using the regression line) is projected forward to determine the regression value for that bar.
  • Regression Band -Middle band, determined by computing a regression line using current bar and previous X-1 bars (X being regression period), and projecting that line forward by Y bars (Y being forecast period), and then taking the endpoint of the line as the value.
  • Upper Band -Standard deviation band drawn above the regression line. Uses the number of standard deviations specified below. The standard deviation is computed over the regression period specified.
  • Lower Band -Standard deviation band below above the regression line. Uses the number of standard deviations specified below. The standard deviation is computed over the regression period specified.
  • Standard Deviation(s) -How many standard deviations from the middle regression band that the upper and lower bands will be drawn.
  • Linear Regression Oscillator -The Linear Regression Oscillator represents the number of standard deviations of current price from the linear regression line. A more complete explanation can be found in the description below.
No examples. Let us know if you'd like to see one added.
No videos. Let us know if you'd like to see one added.