The Commodity Channel Index computes the deviation of the typical price of each bar from the average price over a particular time period. Multiplying the median deviation by 0.015 facilitates normalization, which makes all deviations below the first standard deviation less than -100, and all deviations above the first standard deviation more than 100.
This adaptive version is based on the indicator described by John Ehlers, in the book Rocket Science for traders. The indicator uses the homodyne descriminator to compute the dominant cycle.
To apply the homodyne descriminator, real and imaginary parts have to be calculated from the Inphase and Quadrature components.(Inphase and Quadrature components are deduced using the Hilbert transform. To learn more about this, read the article on Advanced adaptive Indicators theory and implementation. The sections on Complex numbers and phasors for measuring market cycles and also Measuring cycle period. ) To achieve this the product of the current Inphase component and its value a bar ago are added to the product of the current Quadrature component and its value one bar ago to produce the real part. For the imaginary part, the product of the current Quadrature component and the value of Inphase component a bar ago is taken away from the product of the current Inphase component and the value of the Quadrature component a bar ago. Both real and imaginary parts are then smoothed, before the cycle period can be deduced.The cycle is calculated by taking the arctangent of the imaginary part divided by the real part. Restrictions are placed so as to make sure that the rate of change of the cycle period is limited to +-50% of the previous cycle period and further more, the resulting cycle period is limited to being greater than 6 and less than 50. Smoothing is then applied for the last time on the cycle period.
This cycle period value is then used at each bar close as the value that represents the number of bars back to be analyzed for producing the Commodity Channel Index. This enables the adaptive nature of the indicator.
It can be used as an alternative to the conventional Commodity Channel Index.
- The limits value controls the number bars the indicator will be drawn for .
- The cyclepart is a modifier for the calculated cycle period, it helps to make sure that the indicator remains in phase with the price data. The figure can also be used to optimize the indicator for the measured cycle.