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).



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





Number of bars over which to measure the correlation.


First series name.


Second series name.


Offset of the first series.


Offset of the second series.



Statistical correlation for last period length in the barsToMeasure parameter.



'  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 )


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.



Correlation, CorrelationLogSynch, CorrelationSynch, MaxSynchBars

See Also:

Series Functions


Edit Time: 5/2/2017 7:23:16 AM

Topic ID#: 228

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