Download MetaTrader 5

Linking order with EA using Comment?

To add comments, please log in or register
eMPeTrading
197
eMPeTrading  

Hey there, I have a simple coding question:

I know it is possible to link orders with an external EA using Magic Number (for example an EA can update the SL of an order if it has a certain Magic Number). Is it also possible to do the same using the Comment of a order?

Thanks for letting me know!

whroeder1
15934
whroeder1  
eMPeTrading: do the same using the Comment of a order?
  1. Not a good idea, brokers can change comments, including complete replacement.
  2. Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.) Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 forum
Osama Shaban
1575
Osama Shaban  

As long as you know how to do it using magic number, then you need to use the same code

adding just the order comment in the if( ) statement.

eMPeTrading
197
eMPeTrading  

My idea is that I could have used Comment to link a manually entered order into an EA that would normally be linked using a Magic Number form another EA. Is there a viable way how to do this?

Am I correct that a manually entered order cannot have a Magic Number? If it could than all this would be pointless

whroeder1
15934
whroeder1  
eMPeTrading: Am I correct that a manually entered order cannot have a Magic Number?
A manually entered order has a MN of zero.
To add comments, please log in or register