|
RegressionEnd |
Top Previous Next |
|
Finds the end point of a linear regression of the series. Note that this function must be used in conjunction with RegressionSlope. This function merely returns the value already calculated by RegressionSlope, so this function must follow RegressionSlope to return the correct value. The series is a required input parameter. There are no other required values since the end point has already been determined.
Syntax
RegressionEnd( series )
Parameters
Example ' Find the slope of the linear regression of the last 10 closes. ' Once the slope has been found, we can retrieve the end point as well. slope = RegressionSlope( instrument.close, 10 ) endPoint = RegressionEnd( instrument.close )
' Plot the linear regression on the bars that have been used to calculate it. This is postdictive. ' The variable plotRegression is declared as an Instrument Permanent Auto Index Series Variable with plotting.
FOR i = 0 to 9 plotRegression[i] = endPoint - i * slope NEXT
This example shows the use of the common auto indexed series. For information on using functions with non auto indexed series review Series Functions. |