Closing a Position: Auto-Handling ERR_OFF_QUOTES Error

 

Hello,


What would be a good method for auto-handling the OFF QUOTES error?

I've tried the following but with no success:

while (RefreshRates() == false) Sleep( 10 );


I'm trying to close the position and all retries fail over and over again due to that error.

The interesting part is that at some point in time the position is indeed closed, but without my EA being aware of that.


Does anyone have a clue why is that and how to handle this issue?


Thanks,

Simha

 
Anyone?
 

I've seen an Off Quotes error in the past when the bridge between an MT4 Server and an ECN broker back-end was malfunctioning.

When not just a transient problem, this has required broker intervention to resolve.

It is likely to happen more on demo environments (one would hope).

One possible approach would be to retry the trading function for a specified number of times and then spit out a message - perhaps using SendMail().

Hope this helps, but it is really up to you.

CB