hidden the indicator when the value <=0

Questions about MultiCharts and user contributed studies.
nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

hidden the indicator when the value <=0

Postby nuno-online » 14 Aug 2011

Hi

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");
Nuno
Attachments
chart.png
(39.63 KiB) Downloaded 240 times

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Re: hidden the indicator when the value <=0

Postby SP » 14 Aug 2011

Code: Select all

plot1(ccitrend,"CCI Trend");
if ccitrend<=0 then NoPlot (1);


Return to “MultiCharts”