I have an issue with the Boolean.
I have the following code:
if((High[0] >= EMA(7)[0]) || (High[1] >= EMA(7)[0])) (Line1) { if(Close[0] < EMA(7)[0]) (Line2) DrawArrow()}}
Here I want to have ONLY THE FIRST arrow drawn when both conditions of the Line1 are filled and not two arrows.
Later on, still in the downtrend, we have similar situation and two arrows are drawn. Here again, I want ONLY the first arrow.
I have tried to control these conditions with a boolean, but I am failing to fix it. I have the following code:
private bool flagUp = false; if((High[0] >= EMA(7)[0]) || (High[1] >= EMA(7)[0]) && !flagUp) (Line1) { if(Close[0] < EMA(7)[0]) (Line2) DrawArrow(); flagUp = true;} else flagUp =false;}
Thanks in advance!
Comment