Issue with Error number 139 ?

 
Hello,

This is question regarding Error number 139 which states - ERR_ORDER_LOCKED 139 "The order has been locked and under processing. All attempts to make trading operations must be stopped, and the program logic must be changed."

My concern is: If I get Error number 139 I want to avoid placing the same order twice.

If we have an EA as follows:

If Bid > High[1] then
  {
   Send Buy Order # 1;
   }



If we get error number 139 using the EA above, would this EA put on Buy Order # 1 twice?

What happens if we place a buy order and then we get error number 139, does the program automatically stop while the broker is waiting to process the order?

Or do we have to call GetlastError() and the if Error=#139 then we wait for 60 seconds using Sleep function for order to get processed by broker?


Thanks in advance.

Regards

RJF



            
 
You can get error 139 only if you turn on "Ask manual confirmation" and attempt to cancel order after pressing Buy or Sell button. You don't need to send another order.
No error returned from trade server can cause automatical stop of program
 
thanks Slawa. Very much appreciated
Reason: