I'm trying to create an indicator that uses yesterday's close price to filter my "def". I have 3 definitions for stocks (over 3, under 0.75, and between 0.75 and 3). They all work, except the one for stocks priced between 0.75 and 3 displays a plot at all times no matter what the stock price is. So on many stocks I end up with 2 plots, the correct one and the between .75-3 plot. Below is the code snippet to the relevant plots.
I've tried many variations to specify the between values for the price. Such as greater than .75 and less than 3, as well as the two top codes for between .75 and 3. I'm not sure why it insists on plotting it. Any help is appreciated
#plot HHightBetween = if ShowhaltHigh > 0 and Priorclose between 0.75 and 3 then HaltHighBetween else Double.NaN; plot HHightBetween = if ShowhaltHigh > 0 and Priorclose >=0.75 <=3 then HaltHighBetween else Double.NaN; plot HLowBEtween = if ShowhaltLow > 0 and Priorclose between .75 and 3 then HaltLowBetween else Double.NaN; plot HHighUnder = if ShowhaltHigh > 0 and Priorclose <= .75 then HaltHighUnder else Double.NaN; plot HLowUnder = if ShowhaltLow > 0 and Priorclose <= 0.75 then HaltLowUnder else Double.NaN; ############
Last edited by a moderator: