Download MetaTrader 5

How are open trades reference through and EA?

To add comments, please log in or register
Share your programs. That will improve your rating.
Neal_Van
327
Neal_Van 2016.05.13 01:51 
If there are say 5 open orders how are the orders classified or referenced / what names do they have?
Benjamin Dixon
23151
Benjamin Dixon 2016.05.13 05:23  
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
327
Neal_Van 2016.05.13 06:52  
Neal_Van
327
Neal_Van 2016.05.13 07:51  

One more thing... With OrderTicket()

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

Aleksei Beliakov
23880
Aleksei Beliakov 2016.05.13 10:01  
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
327
Neal_Van 2016.05.13 21:11  
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
4685
Marco vd Heijden 2016.05.13 21:16  

Every order returns its own unique ticket number.

Neal_Van
327
Neal_Van 2016.05.14 00:12  
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
4685
Marco vd Heijden 2016.05.14 05:28  

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

To add comments, please log in or register