The CorrelationLog function returns the statistical correlation between two series, for the specified number of bars. These series can be any list of numbers, and does not have to be market data. Can be auto indexed or non auto indexed, and can be IPV or BPV.

 

The Correlation function uses the actual values such as: Value1 and Value 2.

The CorrelationLog function uses the change in the log of the values in the series such as: Log(Value1) - Log(Value2).

 

Syntax:

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

 

Parameter:

Description:

barsToMeasure

Number of bars over which to measure the correlation.

series1

First series name.

series2

Second series name.

offset1

Offset of the first series.

offset2

Offset of the second series.

 

Returns:

Statistical correlation for last period length in the barsToMeasure parameter.

 

Example:

'  Load Soybeans in the BPV Instrument "soybeans"
soybeans.LoadSymbol( "S" )
 
'  Load Gold in the BPV instrument "gold"
gold.LoadSymbol( "GC" )
 
'  Return the Correlation between GC (Gold)
'  and S (Soybeans) over the last 500 days.
Correlation = CorrelationLog( soybeans.close, gold.close, 500 )

Results:

Returns a decimal number between -1 AND 1.

Returns -1 If the two series are perfectly

negatively correlated.

 

Returns 0 If the two series are NOT

correlated at all.

 

Returns 1 If the two series are perfectly

positively correlated.

 

Generally 0.7 OR greater is considered

loosely correlated and 0.9 OR greater

is considered closely correlated.

 

Links:

Correlation, CorrelationLogSynch, CorrelationSynch, MaxSynchBars

See Also:

Series Functions

 


Edit Time: 5/3/2017 09:33:54 AM


Topic ID#: 229

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