How to handle broker "requotes" - page 2

 

I disagree with the whole premise of OrderReliable.

EA's must be coded to recover. That means on Terminal restart (power failure/reboot/crash) the EA must find its open orders and continue.

On orderSend, if you get No Result, the order may or may not have opened. On any error, I log it and return. On the next tick, you will know if the order had opened or not. and can try again if necessary.

I just put a mutex around all server calls to avoid context is busy. No error retry is necessary.

 
WHRoeder:

I disagree with the whole premise of OrderReliable.

EA's must be coded to recover. That means on Terminal restart (power failure/reboot/crash) the EA must find its open orders and continue.

On orderSend, if you get No Result, the order may or may not have opened. On any error, I log it and return. On the next tick, you will know if the order had opened or not. and can try again if necessary.

I just put a mutex around all server calls to avoid context is busy. No error retry is necessary.

Interesting. Could you give more details on the mutex, please? Re: waiting until the 'next tick' to find out if your orders have been created, the next tick could be a long time coming. What about handling orders within a script (tick independent)?
 
HarriMQL4:
Interesting. Could you give more details on the mutex, please? Re: waiting until the 'next tick' to find out if your orders have been created, the next tick could be a long time coming. What about handling orders within a script (tick independent)?

https://www.mql5.com/en/forum/126278

You aren't waiting until the next tick normally, OrderSend tells you the ticket number.

It's during errors that's the problem, especially on a crash or no result returned. Regardless of what error handling/retry you do, you must still have the recovery code anyway. So why bother with the former when you must have the latter?

So what if it's a 'long time' Nothing has changed except price moved one tick and perhaps the transient problem (network, server busy, etc) is gone.

Reason: