How EA understands a modified order?

To add comments, please log in or register
macpee
581
macpee  
Hi everyone.  How can I make my EA to understand that an order has neen modified manually?   Thanks in advance. 
lippmaje
1057
lippmaje  
macpee:
Hi everyone.  How can I make my EA to understand that an order has neen modified manually?   Thanks in advance. 
The EA could keep track of the values that were most recently set by itself for this order, such as S/L and T/P level. If it comes to reconsider the trade, let it check if those values still match, and if not, it must have been done from outside.
macpee
581
macpee  
lippmaje:
The EA could keep track of the values that were most recently set by itself for this order, such as S/L and T/P level. If it comes to reconsider the trade, let it check if those values still match, and if not, it must have been done from outside.
Ok.  Pls how can I get those values.  What command to use, which excludes those placed manually? 
lippmaje
1057
lippmaje  
An EA uses a magic number to distinguish its own from other orders. See the sample EA (Moving Average.mq4) that came with the editor. In CalculateCurrentOrders() it iterates over all open orders and counts those that belong to its magic number. This number of course is also used when opening a new order.
Marco vd Heijden
Moderator
12737
Marco vd Heijden  
Manually placed orders have magic number 0 zero.
To add comments, please log in or register