Download MetaTrader 5

Delete object when order is closed

To add comments, please log in or register
Juraj Ondrusek
405
Juraj Ondrusek  

Hi, I need to help. Know anybody, how to delete object (TEXT_OBJECT with name=OrderTicket()), when that order is already closed?

EXAMPLE:

for(int z=OrdersTotal()-1; z>=0; z--)
{  int sel = OrderSelect(z, SELECT_BY_POS);
   string ticket = (string)OrderTicket();
   Object_Create(ticket);
}
............

When is order closed, object with name as ticket number must be deleted. Big thanks.

Billy Angdijaya
5838
Billy Angdijaya  
Juraj Ondrusek:

Hi, I need to help. Know anybody, how to delete object (TEXT_OBJECT with name=OrderTicket()), when that order is already closed?

EXAMPLE:

for(int z=OrdersTotal()-1; z>=0; z--)
{  int sel = OrderSelect(z, SELECT_BY_POS);
   string ticket = (string)OrderTicket();
   Object_Create(ticket);
}
............

When is order closed, object with name as ticket number must be deleted. Big thanks.

is there any other object?

if not (it's the one and only object), you can use ObjectsDeleteAll.

Juraj Ondrusek
405
Juraj Ondrusek  

Thanks, but Yes, there is more objects.

NOTE1: order is closed by me, not by EA

Juraj Ondrusek
405
Juraj Ondrusek  
I solve it with use array. Thanks all for help.
Billy Angdijaya
5838
Billy Angdijaya  
Juraj Ondrusek:
I solve it with use array. Thanks all for help.
good luck.
To add comments, please log in or register