No Connection to Trade Server

 

If using my EA I sometimes get this message, but I can still manually access the Trade Server.

However, as I want to run the program continuously, this is a problem. In the worst case, my program can initiate a trade

but then if the connection breaks down, my EA can not close the trade when appropriate leaving me exposed.

Has anyone else had this problem and what did you do?