is it possible to hide the indicator when the value <=0
here is the chart and the code
Code: Select all
inputs: ccilength(50), atrlength(5), colorup(blue), colordn(red);
vars: ccitrend(0);
//up
if cci(ccilength)>=0 then begin
ccitrend=low-AvgTrueRange(atrlength);
if ccitrend<ccitrend[1] then ccitrend=ccitrend[1];
setplotcolor(1,colorup);
end;
//dn
if cci(ccilength)<0 then begin
ccitrend=high + AvgTrueRange(atrlength);
if ccitrend>ccitrend[1] then ccitrend=ccitrend[1];
setplotcolor(1,colordn);
end;
plot1(ccitrend,"CCI Trend");