Finds the linear regression slope of the series.

 

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:

RegressionSlope( series, bars, [offset] )

 

Parameter:

Description:

series

Then name of the series.

bars

The number of bars over which to find the value.

[offset]

Then number of bars to offset before finding the value.

 

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.
 
'  This statement retrieves the Slope of the Close
slope = RegressionSlope( instrument.close, 10 )
 
'  This Statment returns the Regression End value.
endPoint = RegressionEnd( instrument.close )
 
'  Plot the linear regression on the bars that
'  have been used to calculate it. This is  a
'  postdictive calculation.
 
'  The variable plotRegression is declared as
'  an Instrument Permanent Auto Index Series
'  Variable with plotting.
 
'  Plot the Regression for the last 10 values
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.

Returns:

This example shows the Regression Slope value of an example auto indexed series.  For information on using functions with non auto indexed series review Series Functions.

 

Links:

RegressionEnd

See Also:

Series Functions

 


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


Topic ID#: 493

 

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