rescue information from old OrderTicket()

 

Hi all, my expert writes a Global Variable in this way 

StringConcatenate(...,Symbol(),OrderTicket()); 

but when half position is closed on profit, the OrderTicket() is changed from the broker and the expert is not able to modify the Global Variable properly.

Is there a way to rescue the link to old OrderTicket() ?

Thank you! 

 
Alberto Tortella:

Hi all, my expert writes a Global Variable in this way 

but when half position is closed on profit, the OrderTicket() is changed from the broker and the expert is not able to modify the Global Variable properly.

Is there a way to rescue the link to old OrderTicket() ?

Thank you! 

Use OrderSelect() for OrderTotals() to identify the changed situation. If you keep your current positions/ticket in an array you can identify what is new or closed and compare new and old positions/ tickets 
Reason: