This indicator is a generalization of the Commodity Channel Index indicator and calculates the values of the commodityChannelIndex indicator over all sub-periods of a given length.
An array of length equal to the number of periods considered in the indicator evaluation where the first element is the high in the last trading period, the second term is the high in the previous period and so on.
low
An array of length equal to the number of periods considered in the indicator evaluation where the first element is the low in the last trading period, the second term is the low in the previous period and so on.
closing
An array of length equal to the number of periods considered in the indicator evaluation where the first element is the closing price in the last trading period, the second term is the closing price in the previous trading period and so on.
length
An integer which represents the length of the period over which the indicator will be iteratively evaluated.
Return Value
An array where the k-th term corresponds to the value of the Commodity Channel Index over the k-th previous period.
Thrown if any elements from the arrays high, low or close are strictly negative, or if the length of the arrays is not equal or the lengthOfPeriod is grater than the length of the array high.