Finds the value of a linear regression of the series at any point using an offset.

 

Note:

This function must be used in conjunction with RegressionSlope because it merely returns the slope and endpoint already calculated by RegressionSlope.  This means this function must follow RegressionSlope to return the correct value.

 

The series is a required input parameter and an offset.

 

This example shows the use of the common auto indexed series.

 

For information on using functions with non auto indexed series review Series Functions.

 

Syntax:

RegressionValue( series, offset )

 

Parameter:

Description:

series

The name of the series.

offset

The number of bars back.

 

Example:

'  Find the slope of the linear regression of the last 10 closes.
slope = RegressionSlope( instrument.close, 10 )
 
'  Plot the linear regression on the bars
'  that have been used to calculate it. This
'  is postdictive calculation result.
'
'  The variable plotRegression is declared
'  as an Instrument Permanent Auto Index
'  Series Variable with plotting.
 
For i = 0 TO 9
  plotRegression[i] = RegressionValue( instrument.close, i )
Next

Returns:

Regression Slope value at the offset bar location.

 

Links:

RegressionSlope

See Also:

Series Functions

 


Edit Time: 9/25/2017 09:09:54 AM


Topic ID#: 494

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software