Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Average CCI - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources - MetaTrader 5 Resources

author EAcpu | 3 reads | 0 comments |

CCI of average - indicator for MetaTrader 5

CCI of average - indicator for MetaTrader 5

The Commodity Channel Index ( CCI ) is an oscillator originally proposed by Donald Lambert in 1980.

CCI measures how different a security is from a statistical average.

CCI is calculated as the difference between a commodity's typical price and its simple moving average divided by the average absolute deviation of the typical price. The index is usually scaled by the reciprocal 0.015 to provide a more readable number:

CCI of average - indicator for MetaTrader 5

Where is the typical price (highest price + lowest price + closing price)/3 , SMA is the simple moving average, and MD is the mean absolute deviation.

For scaling purposes, Lambert set the constant to 0.015 to ensure that approximately 70% to 80% of CCI values ​​would fall between −100 and +100. CCI fluctuates around zero. A quantity whose percent CCI value falls between +100 and −100 depends on the number of periods used by the quantity. The shorter the CCI, the less volatile the CCI is as a percentage of values ​​between +100 and −100. Conversely, the more periods used to calculate the CCI, the higher the percentage of values ​​between +100 and -100.

Sometimes CCI is "tense" - if you use it for signals based on horizontal crossovers, it can produce a lot of false signals. One possible approach is to pre-filter prices before being used in CCI calculations (this reduces latency significantly compared to smoothing the calculated CCI). This version does the following: Use pre-filtered prices for CCI calculations. You can use the common set of average types:

Choose one of 3 coloring modes (slope, level or color change on zero crossing) and you can use the color change as a signal.

CCI of average - indicator for MetaTrader 5


Attachment download

📎 cci_of_average.mq5 (8.94 KB)

Source: MQL5 #22742

Verification code Refresh