inputs:
Length( 14 ),
CCIAvgLength( 9 ),
OverSold( -100 ),
OverBought( 100 ),
OverSColor( Cyan ),
OverBColor( Red ) ;
variables:
CCIValue( 0 ) ,
CCIAvg( 0 ) ;
CCIValue = CCI( Length ) ;
CCIAvg = Average( CCIValue, CCIAvgLength ) ;
Plot1( CCIValue, "CCI" ) ;
Plot2( OverBought, "OverBot" ) ;
Plot3( OverSold, "OverSld" ) ;
Plot4( CCIAvg, "CCIAvg" ) ;
{ Color criteria }
if CCIValue > OverBought then
SetPlotColor( 1, OverBColor )
else if CCIValue < OverSold then
SetPlotColor( 1, OverSColor ) ;
{ Alert criteria }
if CCIValue crosses over OverSold then
Alert( "Indicator exiting oversold zone" )
else if CCIValue crosses under OverBought then
Alert( "Indicator exiting overbought zone" ) ;
Comment