ChartDirector 6.0 (C++ Edition)



ArrayMath& movCorr(int interval, DoubleArray b = DoubleArray());


Replaces each element of the ArrayMath object by the moving correlation with another array or with itself.

The interval parameter specifies the window size for computing moving correlation. The moving correlation is computed as the correlation coefficient between the ArrayMath object and the other array, where only the current element and the previous (interval - 1) elements are considered in the computation.

If the other array is not provided, it is assumed to be the sequence of numbers 0, 1, 2, 3, 4.... This is equivalent to checking if the elements of the ArrayMath object is linear.

No moving correlation can be computed for the first (interval - 1) elements, because there are insufficient previous elements. So the first (interval - 1) elements will be replaced with NoValue.


interval(Mandatory)The window size.
b[Empty_Array]The array to be correlated with the ArrayMath object. If this argument is an empty array, the sequence of numbers 0, 1, 2, 3, 4 .... will be used instead.

Return Value

The current ArrayMath object.