I have a problem deleting Lines that i drawn with my indicator.
The indicator draws new lines while the market is open (between 8:30am and 3:00pm), when the market closed i call RemoveDrawObjects(); to delete all Lines but it does not work.
For example i am adding the indicator at 9:10pm and i saw the lines, so i put a log to see if the RemoveDrawObjects(); method is called and yes it is called but the lines stille appear.
To draw the lines i use:
NinjaTrader.NinjaScript.DrawingTools.Line myLine = Draw.Line(this, mylineName, true, closeStartTime, closeStartY, closeEndTime, closeEndY, true, "");
the name of the line myLineName it is a concatenation of a string "myLine" + Time[0].ToString() to have different names with every Line.
And to remove all lines i use RemoveDrawObjects();
when I add the indicator at 9:10 pm since it is not between open market hours I am not supposed to see any lines, but....
Thank you for your help!!

Comment