Let say I add these 2 line at the end of MACD code in OnBarUpdate()
if (Diff[0] > 0) DrawDot("dot" + CurrentBar, false, 0, 0, Color.Blue);
else if (Diff[0] < 0) DrawDot("dot" + CurrentBar, false, 0, 0, Color.Red);
It just draw a blue/red dot on the zeroline when cross. It works fine with CalculateOnBarClose=True, but everything stop working when set to false. I think it is because it try to redraw the dot on the same place that is causing the problem. How do I fix it.
Comment