How to number open trades on chart - page 2

 
erzo:
You are absolutely right. But you must indexing because you created labels for orders that might be closed over time, and you will not find them without indexing. I found a possibly error in my code however: if an object has been deleted by user after StringSubstr check but before delete calling, it might delete another object accidentally. Correcting:
Moreover: if you run this at the begining of strart(), it could clear all the old objects

Thanks erzo.

I tried your code above, at the beginning of start(), but it doesn't work correctly. It deletes the wrong numbers from the chart. Possibly to do with the counting. We're still on the drawing board with this one. Seemed a simple need, but proving difficult to do.

 
davidb_012:

Thanks erzo.

I tried your code above, at the beginning of start(), but it doesn't work correctly. It deletes the wrong numbers from the chart. Possibly to do with the counting. We're still on the drawing board with this one. Seemed a simple need, but proving difficult to do.


Addendum:

Actually it does appear to be working. Thanks everyone.

Phew! Time for more than a cup of tea, as earlier suggested.

Reason: