input: Price ((h+l+c)/3), Length (14), Scale (245), LineUpper(100), LineLower(-100); plot1(DevCCI(Price,Length,Scale),"DevCCI"); plot2(LineUpper,"Upper"); plot3(LineLower,"Lower"); plot4(0,"0"); { Alert criteria } if Plot1 crosses over LineLower then Alert( "CCI crosses over " + NumToStr(LineLower,0) ) else if Plot1 crosses under LineLower then Alert( "CCI crosses under " + NumToStr(LineLower,0) ) else if Plot1 crosses over LineUpper then Alert( "CCI crosses over " + NumToStr(LineUpper,0) ) else if Plot1 crosses under LineUpper then Alert( "CCI crosses under " + NumToStr(LineUpper,0) ) else if Plot1 crosses over 0 then Alert( "CCI crosses over zero" ) else if Plot1 crosses under 0 then Alert( "CCI crosses under zero" ); input: Price (NumericSeries), Length(NumericSimple), Scale (NumericSimple); var: Sdv(0); Sdv = StandardDev( Price, Length, 1 ); if Sdv = 0 then DevCCI = DevCCI[1] else DevCCI = ( (Price - AverageFC( Price, Length )) / Sdv ) / 3 * scale;