This one should smooth out the CCI for ya lad. Red and Green indicators on as it crosses major horizontal lines. Designed to create buy/sell alerts on any cross for a major line (-200, -100, 0, 100, 200). Bloody well make some quid with this one.
#-----------------------------------------------------------begin code
declare lower;
input cciLength = 50;
input cciAvgLength = 20;
input keyLevel1 = 200;
input keyLevel2 = 100;
def CCI = CCI(length = cciLength);
plot Level1a = keyLevel1;
plot Level1b = -keyLevel1;
plot Level2a = keyLevel2;
plot Level2b = -keyLevel2;
plot ZeroLevel = 0;
plot CCIAvg = Average(CCI, cciAvgLength);
cciAvg.AssignValueColor(if (CCIAvg > keyLevel1 && CCIAvg[1] < keyLevel1) OR
(CCIAvg > keyLevel2 && CCIAvg[1] < keyLevel2) OR
(CCIAvg > -keyLevel1 && CCIAvg[1] < -keyLevel1) OR
(CCIAvg > -keyLevel2 && CCIAvg[1] < -keyLevel2) OR
(CCIAvg > 0 && CCIAvg[1] < 0) then Color.UPTICK else if (CCIAvg < keyLevel1 && CCIAvg[1] > keyLevel1) OR
(CCIAvg < keyLevel2 && CCIAvg[1] > keyLevel2) OR
(CCIAvg < -keyLevel1 && CCIAvg[1] > -keyLevel1) OR
(CCIAvg < -keyLevel2 && CCIAvg[1] > -keyLevel2) OR
(CCIAvg < 0 && CCIAvg[1] > 0) then Color.DOWNTICK else GetColor(7) );
Level1a.SetDefaultColor(GetColor(9));
Level1b.SetDefaultColor(GetColor(9));
Level2a.SetDefaultColor(GetColor(9));
Level2b.SetDefaultColor(GetColor(9));
ZeroLevel.SetDefaultColor(GetColor(9));
Level1a.SetStyle(Curve.SHORT_DASH);
Level1b.SetStyle(Curve.SHORT_DASH);
Level2a.SetStyle(Curve.SHORT_DASH);
Level2b.SetStyle(Curve.SHORT_DASH);
ZeroLevel.SetStyle(Curve.SHORT_DASH);
CCIAvg.SetLineWeight(3);
#---------------------------------------------------------end code