There are several ways to use the Commodity Channel Index (CCI) in trading but it often involves setting levels and deciding what to do when those levels are broken or crossed. However, by adding a moving average to the signal, we can turn the CCI indicator into an easy to use trend detector, and then use this to make a PIN.

How the CCI Moving Average works

In the main image, a simple moving average has been added to the CCI indicator chart. The CCI is drawn in white and the simple moving average of the CCI (CCIMA) is drawn in yellow. You can see how the simple addition of the MA line, even with very basic parameters (CCI=14 and SMA=10), does quite a good job of identifying the price trend.

The PIN simply compares the CCI to the CCIMA:

  • CCI above the CCIMA = BUY
  • CCI below the CCIMA = SELL

(This is a simple directional PIN and does not provide any cross detection).

In the PIN settings, you can change the CCI Period, CCI Method and the MA Period. You can also disable or enable individual timeframes.

JagzFX CCIMA MTF PIN v1.00 settings
JagzFX CCIMA MTF PIN v1.00 settings

Download “JagzFX CCI Moving Average MTF PIN”

JagzFX_PIN_CCIMA_MTF_v1_02.ex4 – Downloaded 182 times – 38.13 KB

CCIMA PIN Change Log

//+------------------------------------------------------------------+
//|                                       CCI Moving Average MTF PIN |
//|                                           Copyright 2020, JagzFX |
//|                                               https://jagzfx.com |
//+------------------------------------------------------------------+
//| v1.00   CCI Moving Average
//| v1.01   Fixed bug in instance id preventing display of multiple PINS
//| v1.02   Fixed a mistake in the above were only pin number was used as instance id
//|   "     Fixed refresh bug (use OnTimer)