[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unwanted simultaneous plots...



PureBytes Links

Trading Reference Links

Hello everyone,

I have an indicator which calculates two values for me. I want to plot one 
of them when in uptrend and the other in downtrend. Now, let's assume I 
consider an uptrend if rsi(x) goes higher then 70, and the uptrend 
continues until rsi(x) drops under 30, and vice versa. So here's what I coded:

if rsi(x)>70 and rsi(x)[1]<70 then counter=1;
if rsi(x)<30 and rsi(x)[1]>30 then counter=2;
if counter=1 then plot1 (high+1, "value1");
if counter=2 then plot2 (low-1, "value2");

The problem is that here and there BOTH values plot on the same bar. I 
don't see how that's even POSSIBLE!

Can anyone help me with this?

TIA

Philip