This is the code I tried to figure out by browsing for codes online.
As you can see in this snapshot first point above zero is red. Going by the code it should be green, right? And this is the same case with first point below zero is green, but it supposed to be red. How to get it right? I mean above zero, cloud colour should be green and below zero cloud colour should be red.
_SECTION_BEGIN("CCI");
periods = Param( "Periods", 20, 2, 200, 1 );
Plot( CCI( periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Centre = 0;
Plot(Centre, "" , colorWhite, styleNoLabel | styleDashed ) ;
N=CCI(periods);
PlotOHLC (N,N,0,N, "", IIf (N>0,colorGreen,colorRed),styleCloud);
_SECTION_END();
periods = Param( "Periods", 20, 2, 200, 1 );
Plot( CCI( periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Centre = 0;
Plot(Centre, "" , colorWhite, styleNoLabel | styleDashed ) ;
N=CCI(periods);
PlotOHLC (N,N,0,N, "", IIf (N>0,colorGreen,colorRed),styleCloud);
_SECTION_END();
As you can see in this snapshot first point above zero is red. Going by the code it should be green, right? And this is the same case with first point below zero is green, but it supposed to be red. How to get it right? I mean above zero, cloud colour should be green and below zero cloud colour should be red.