I have an indicator that draws a short horizontal line when a specific condition is met.
I am using (a)
DrawLine("Rising0", false, barsForward, EMA(20)[0], barsBack0, EMA(20)[0], up0, DashStyle.Solid, wline0);
and (b)
if (pasthlines_On) DrawLine("Rising0b" + CurrentBar, false, barsForward, EMA(20)[0], barsBack1, EMA(20)[0], up0, DashStyle.Solid, wline0);
The reason I have both is that sometimes I want to see the past ones, sometimes not.
a) behaves nicely in that the line appears and disappears when the condition happens to change within the same bar.
But when I have (b) also activated, then what happens is that
(a) draws the line and (b) also. And while when the condition changes within the same bar, the line drawn from (a) disppears but the one drawn by (b) remains (unless I push F5) when I would want it to also disappear.
It's kind of like I need to run (a) on BarClose False while (b) needs to run on BarClose True. I could achieve that by running the indicator twice. But is there perhaps another way to achieve the same?
Hope I was clear and look forward to see if someone has an idea.
sandman
Comment