Simple CCI Modified Code

rajputz

Well-Known Member
#1
Hi Friends,

Visiting traderji after a long time. I wanted a help regarding a simple CCI code. I use woodies cci for my trading as i have shown in the pic. I wanted the simple CCI in modified version. The details of the CCI i want are given below.

Background Panel - WHITE
0 100 200 300/-100 -200 -300 lines - THICK LINE BLACK
CCI 20 - GREEN WHEN ABOVE 0/RED WHEN BELOW 0 (THICK LINE)
CCI 6 - YELLOW

Its simple but i dont know the coding. I wish anyone could make this afl for me.
 

Attachments

Last edited:

KelvinHand

Well-Known Member
#2
Hi Friends,

Visiting traderji after a long time. I wanted a help regarding a simple CCI code. I use woodies cci for my trading as i have shown in the pic. I wanted the simple CCI in modified version. The details of the CCI i want are given below.

Background Panel - WHITE
0 100 200 300/-100 -200 -300 lines - THICK LINE BLACK
CCI 20 - GREEN WHEN ABOVE 0/RED WHEN BELOW 0 (THICK LINE)
CCI 6 - YELLOW

Its simple but i dont know the coding. I wish anyone could make this afl for me.
Code:
// Background colors

SetChartBkColor(ParamColor("Panel color ",colorPaleBlue)); 

// CCI colors

zcolor=ParamColor("CCI Outline color",colorBlack);
zcolorUp=ParamColor("CCI-H Up color",colorLime);
zcolorDn=ParamColor("CCI-H Dn color",colorRed);


z6color=ParamColor("TCCI color",colorYellow);
// CCI periods

zperiod=Param("CCI Period",20,0,100);
z = CCI(zperiod); 
z6period=Param("TCCI Period",6,0,1000);
z6 = CCI(z6period); 



// Plot the 100s 

Plot(100,"", colorLightGrey , styleLine | styleThick | styleNoLabel); 
Plot(-100,"", colorLightGrey , styleLine | styleThick | styleNoLabel); 

// Plotthe 200s

Plot(200,"", colorLightGrey, styleLine | styleThick | styleNoLabel); 
Plot(-200,"", colorLightGrey, styleLine | styleThick | styleNoLabel);

// Plotthe 200s

Plot(300,"", colorLightGrey, styleLine | styleThick | styleNoLabel); 
Plot(-300,"", colorLightGrey, styleLine | styleThick | styleNoLabel);


// zero line 

Plot(0,"", colorLightGrey , styleLine | styleThick | styleNoLabel); 



// CCI Line 

Plot(z,"CCI", zcolor, styleLine | styleThick);
Plot(z6,"TCCI", z6color, styleLine); 

// CCI Histogram 
Color =IIf(z>0, zcolorUp, IIf(z<0, zcolorDn, zcolor));
Plot(z,"CCI-H",Color,styleHistogram | styleThick | styleNoLabel);
 

Similar threads