Correlation is a series function that uses the Pearson's correlation coefficient method to return the statistical coefficient for the range of bars between two markets entered into the first two parameters of this function.

 

Syntax:

Correlation( series1, series2, barsToMeasure, [offset1], [offset2] )

 

Parameter:

Description:

series1

Series element/property value of the first series.

series2

Series element/property value of the second series.

barsToMeasure

Number of bars over which to measure the correlation coefficient.

[offset1]

Optional: Offset value for the first series.

[offset2]

Optional: Offset value for the second series.

 

Example:

'  Load first parameter's instrument series
soybeans.LoadSymbol( "S" )
'  Load second parameter's instrument series
gold.LoadSymbol( "GC" )
'  Calculate the coefficient value between the two series
coefficient = Correlation( soybeans.close, gold.close, 500 )

Returns:

Above example will returns the correlation coefficient between GC and S over the last 500 days.

Return Range Values:

Correlation Meaning:

1.0

Value 1 indicates there is a perfect positive correlation between the two series.

oValues less than 0.7 is generally considered Uncorrelated.

oValues between 0.7 to 0.9 is generally considered Loosely correlated.

oValues greater than 0.9 is considered Closely correlated.

0

Value of 0 indicates there is no correlation between the two series

-1.0

Value of -1 indicates the two series have a perfect negative correlation.

oValues greater than -0.7 is generally considered Uncorrelated.

oValues between -0.9 to -0.7 is generally considered Loosely correlated.

oValues less than -0.9 is considered Closely correlated.

 

Links:

Correlation Properties, CorrelationSynch, CorrelationLogSynch, MaxSynchBars

See Also:

Mathematical Functions, Series Functions,

 


Edit Time: 9/12/2020 10:28:44 AM


Topic ID#: 224

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