Factors Directory

Quantitative Trading Factors

Commodity Channel Index

Overbought and OversoldTechnical FactorsMomentum Factor

factor.formula

Typical Price (TP):

Commodity Channel Index (CCI(N)):

Mean Absolute Deviation (MAD):

in:

  • :

    Typical Price, which represents the average of the high, low and closing prices within a trading day, is used to capture the central price level of the trading day. The calculation formula is: (highest price + lowest price + closing price) / 3.

  • :

    The N-day Simple Moving Average (Simple Moving Average) refers to the arithmetic average of the typical price (TP) of the past N periods. It smoothes price fluctuations and provides a baseline for price trends. The N value is usually set to 20 and can be adjusted according to the specific transaction target and time period.

  • :

    The N-day Mean Absolute Deviation (MAD) is an indicator that measures the volatility of a typical price (TP) over N periods. It calculates the average of the absolute values ​​of the difference between each TP and its N-day simple moving average (SMA(TP,N)). A larger MAD value indicates a greater price volatility, and vice versa.

  • :

    The calculation period parameter indicates the time window size used to calculate the moving average and average absolute deviation. It is usually set to 20 trading days, but can be adjusted according to the characteristics of the trading target and the trading strategy. A smaller N value will make the CCI more sensitive, while a larger N value will make the CCI smoother.

factor.explanation

The Commodity Channel Index (CCI) is a momentum oscillator that measures how far the current price deviates from its statistical average. It is calculated as the difference between the current typical price (TP) and its N-day simple moving average (SMA(TP,N)), divided by a scaling factor (0.015 times the N-day mean absolute deviation (MAD(TP,N))). The scaling factor is used to normalize the CCI values ​​so that it is within the range of -100 to +100 approximately 70% to 80% of the time. When the CCI is above +100, it is generally considered to be in overbought territory, indicating that prices may pull back; when the CCI is below -100, it is generally considered to be in oversold territory, indicating that prices may rebound. The CCI can also be used to identify divergences between price and the indicator to predict potential price trend reversals. For example, when prices make new highs and the CCI does not make new highs, it may indicate a weakening of the upward momentum of prices.

Related Factors