How are open trades reference through and EA?

 
Neal_Van:
If there are say 5 open orders how are the orders classified or referenced / what names do they have?

https://www.mql5.com/en/articles/1359

https://docs.mql4.com/trading/orderticket 

MagicNumber: "Magic" Identifier of the Order
MagicNumber: "Magic" Identifier of the Order
  • 2006.07.24
  • Andrey Khatimlianskii
  • www.mql5.com
The article deals with the problem of conflict-free trading of several experts on the same МТ 4 Client Terminal. It "teaches" the expert to manage only "its own" orders without modifying or closing "someone else's" positions (opened manually or by other experts). The article was written for users who have basic skills of working with the terminal and programming in MQL 4.
 
 

One more thing... With OrderTicket()

How do I reference more than one ticket if there are many open trades? 

 
Neal_Van:

One more thing... With OrderTicket()

How do I reference more than one ticket if there are many open trades? 

https://www.mql5.com/en/articles/1359
MagicNumber: "Magic" Identifier of the Order
MagicNumber: "Magic" Identifier of the Order
  • 2006.07.24
  • Andrey Khatimlianskii
  • www.mql5.com
The article deals with the problem of conflict-free trading of several experts on the same МТ 4 Client Terminal. It "teaches" the expert to manage only "its own" orders without modifying or closing "someone else's" positions (opened manually or by other experts). The article was written for users who have basic skills of working with the terminal and programming in MQL 4.
 
Aleksei Beliakov:
https://www.mql5.com/en/articles/1359
I'm not getting it.. If I use OrderTicket I can only get one ticket number.  
 

Every order returns its own unique ticket number.

 
Marco vd Heijden:

Every order returns its own unique ticket number.

Yes but how do I access it if there are more than one...

Is there a way to store ticket numbers in a variable? 

 

Of course there is this happen when you open the order.

Reason: