hidden the indicator when the value <=0

Questions about MultiCharts and user contributed studies.
nuno-online
Posts: 166
Joined: 31 Jan 2006
Has thanked: 72 times
Been thanked: 3 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
chart.png (39.63 KiB) Viewed 115 times

SP
Posts: 444
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 280 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);
These users thanked the author SP for the post (total 2):
nuno-onlineJoshM


Return to “MultiCharts”