Time Series Forecast

The Time Series Forecast (TSF) indicator displays the statistical trend of a security's price over a specified time period. The trend is based on linear regression analysis. Rather than plotting a straight linear regression trendline, the Time Series Forecast plots the last point of multiple linear regression trendlines. The difference between the TSF and the moving linear regression is that the TSF adds the slope of the linear regression to the linear regression essentially projecting the position of the linear regression forward one period.

Custom PCF Formula
Of Price AVGCx.z + ((x - 1) / 2 + y) * 6 * (FAVGCx.z - AVGCx.z) / (x - 1)
x=Period, y=ForecastBars, z=Offset
Generalized AVG(w, x) + ((x - 1) / 2 + y) * 6 * (FAVG(w, x) - AVG(w, x)) / (x - 1)
w=Numeric, x=Period, y=ForecastBars

Where x is the period which must be an integer.

Where y is the forecast bars setting which must be an integer.

Where z is the offset. An offset of 1 returns the value from the previous bar instead of the current bar.

Where w is any formula returning a numeric value.

In the example below, we have the Time Series Forecast (yellow) plotted with a Linear Regression Line (red) and a Moving Linear Regression (cyan).  You can see where the TSF is projecting the position of the linear regression on the next bar.