deleting created objects ??
-
- Posts: 17
- Joined: Mon Jan 30, 2012 2:31 pm
deleting created objects ??
Don't I need to delete all objects that I create??
-
- Posts: 151
- Joined: Tue Feb 24, 2009 1:03 pm
I think my answer was a little knee-jerk. I believe there are certain instances when you should delete the objects you create, such as when an indicator draws lots of objects on screen it should really clean up after itself and delete the objects when it is removed from the chart.
There are times when it's not needed. For instance, I just created a strategy that draws some objects. Whenever the strategy is re-started using the toolbar stop/start button all of the objects are automatically deleted so in this case I see no need to do it in code.
As far as memory allocation is concerned I would expect that in those instances where FT clears the objects from the screen it also clears them from memory.
There are times when it's not needed. For instance, I just created a strategy that draws some objects. Whenever the strategy is re-started using the toolbar stop/start button all of the objects are automatically deleted so in this case I see no need to do it in code.
As far as memory allocation is concerned I would expect that in those instances where FT clears the objects from the screen it also clears them from memory.
-
- Posts: 17
- Joined: Mon Jan 30, 2012 2:31 pm
thanks for the replies ...
is there some documentation about how the API/FX Tester handles this? I mean I would like to know under what instances I have delete the objects I create and under which I dont. I don't want to be springing leaks all over the place
-
- Posts: 151
- Joined: Tue Feb 24, 2009 1:03 pm
-
- Posts: 905
- Joined: Sat Jul 11, 2009 10:54 am
When you create some object on charts it becomes a separate instance which is not associated with your indicator. So the object lives its own life and if you want the chart to stay clean after you remove the indicator then you have to delete your objects in "Done" procedure.
You can use some prefixes/suffixes in object names to distinguish your objects from other ones.
You can use some prefixes/suffixes in object names to distinguish your objects from other ones.
Check our other product here:
http://www.forexcopier.com
http://www.forexcopier.com
Who is online
Users browsing this forum: No registered users and 11 guests