I have built an indicator which displays various market depth values at there respective levels, drawn with draw,text and each has its tag with a standard name + Currentbar and its Price level so all unique (e.g. BidSpread305971.20905). This works very well until there are a lot of them drawn it starts to slow down due to all the objects being held in memory I'm guessing, i would just like to remove these drawing objects after a certain number of bars. I have tried the RemoveDrawObject command using a string made up of the name + the CurrentBar less the number of bars to keep + i have tried regex, wildcards etc for any value after this to match the price component of the tag. I also tried to foreach loop through the texts in drawingobjects but cannot as it tells me object has been modified. So anyway, i was wondering if you would know of a simple way to limit the number of drawn objects of a certain type. Any advice much appreciated.
Thanks
Col

Comment