Download MetaTrader 5

How are open trades reference through and EA?

To add comments, please log in or register
Neal_Van
334
Neal_Van  
If there are say 5 open orders how are the orders classified or referenced / what names do they have?
Benjamin Dixon
23685
Benjamin Dixon  
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.
Neal_Van
334
Neal_Van  
Neal_Van
334
Neal_Van  

One more thing... With OrderTicket()

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

Aleksei Beliakov
27372
Aleksei Beliakov  
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.
Neal_Van
334
Neal_Van  
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.  
Marco vd Heijden
Moderator
4995
Marco vd Heijden  

Every order returns its own unique ticket number.

Neal_Van
334
Neal_Van  
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? 

Marco vd Heijden
Moderator
4995
Marco vd Heijden  

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

To add comments, please log in or register