I have the following code that works perfectly:
if (downScore == 0 && High [0] < upTarget && upStop == 0)
{DrawDot ("upTarget1" + CurrentBar,true,0,upTarget,Color.Green);}
The problem is when I want DrawDot to stop. Once the high of the current bar exceeds the upTarget (which is a set price) I want to change the value of upStop to 1, so I tried this:
if High [0] > upTarget
{upStop = 1}
My thinking was that this first piece of code above would no longer Draw the Dot because upStop would not = 0.
What happens when I add that second piece of code is ALL my dots disappear. I don't understand why since on bar close of the past bars the condition for the DrawDot was met. It is only when price is above the target that I want to stop DrawDot, not wipeout all previous dots.
What am I missing. Thanks in advance for your guidance.
Comment