I was checking the formula of built-in "cci" function and decided to publish a more customizable version of the Commodity Channel Index, so you can play with levels and a bunch of different sources.
If someone doesn't know what is this:
This indicator was originally developed by Donald R. Lambert ("Commodities" magazine, 1980) to identify cyclical or seasonal price patterns in commodities. Now it is applied not only to commodities but to market indices, stocks and Forex.
Good luck!