NC CCI Description
NC CCI is a CCI indicator for NinjaTrader 8, and it comes with the full C# source code. With the default settings it is the classic Commodity Channel Index. What I added is the freedom to swap its parts: the moving average, the price it reads and the way it signals. CCI is jumpy by nature, and a smoother average won't change that completely, but it lets you test ideas the standard version locks away.
How it works. The CCI measures how far price is from its moving average, divided by 0.015 times the average distance from that MA. Input Type picks the price: Typical (default), Close, Median or Weighted. MA Type picks the average: SMA by default, or EMA, HMA, TMA, TEMA, VWMA, WMA and John Ehlers' Super Smoother, a two-pole filter that removes short-term noise. MA Period (14) sets the average, and Period (14) sets how many bars the average distance covers. Signal Type has two modes. Classic fires when the CCI leaves a zone: -1 when it falls back below Threshold Top (100), +1 when it rises back above Threshold Bottom (-100). ZoneEntry fires when it enters one: +1 on a cross above Threshold Top, -1 on a cross below Threshold Bottom.
What you see. A goldenrod CCI line in its own panel, with gray lines at Threshold Top and Threshold Bottom that follow your settings. Turn on Plot Signals and every signal puts an arrow on the price chart: dark green below the bar for +1, dark red above it for -1, sized by Arrow Size (14). It calculates on bar close, so a signal is final once its bar closes.
How to use it. Classic signals suit mean reversion: you wait for the CCI to come back from an extreme instead of fading it while it's still stretched. ZoneEntry suits momentum, where a push above 100 shows strength. Try the Super Smoother or an HMA for a cleaner line, and move the thresholds out to 200 and -200 if you only care about extreme moves. The hidden Signals plot holds the same +1, -1 and 0, so a strategy can use it directly.
Make it yours. Use it as is, learn from the code, or change it yourself or with AI like Claude. You could add a sound alert on each signal, only take signals in the direction of a longer moving average, or add a third signal type for zero-line crosses. Picking the average, picking the input and the signal rules are separate pieces of code, so changing one doesn't touch the others. Have some good trades!