CCI
The Commodity Channel Index (CCI) is a timing tool that works best with
seasonal or cyclical contracts. It keeps trades neutral in a sideways moving
market, and helps get in the market when a breakout occurs.
The Commodity Channel Index (CCI) is calculated by first determining the
difference between the mean price of a commodity and the average of the means
over the time period chosen. This difference is then compared to the average
difference over the time period (this factors in the commodity's own inherent
volatility). The result is then multiplied by a constant that is designed to
adjust the CCI so that it fits into a "normal" trading range of +/-100.
Syntax:
Public Function CCI(ByVal HLOCV()() As Double, ByVal Method As axltaMovingAverageType, ByVal Lag As Long) As Double
Parameters:
- ByVal HLOCV()() As Double
- ByVal Method As axltaMovingAverageType
- ByVal Lag As Long
Back to list
Example:
Dim TA4Net As
New TA4Net.CTAFunctions("YOUR-REGISTRATION-CODE")
Dim Result() As
Double
Dim
HLOCV(,) As
Double
' loading values to array
HLOCV =
GetHLOCVValues()
' calculating Technical Analysis function
Result = TA4Net.CCI(HLOCV, TA4Net.axltaMovingAverageType.axltaMovExponential, 14)
|