!! emercency!! my ea sometimes does not start..

 
my ea sometimes does not start trading. After a while it return to normal.I suspect vps hosting. there may be a disconnection problem. How can I find out whether the mt4 program has been restarted or the vps hosting has been restarted. why this may be the problem.
 
  1. EAs must be coded to recover. If the power fails, OS crashes, terminal or chart is accidentally closed, on the next tick, any static/global ticket variables will have been lost. You will have an open order but don't know it, so the EA will never try to close it, trail SL, etc. How are you going to recover? Use a OrderSelect loop to recover, or persistent storage (GV+flush or files) of ticket numbers required.

  2. Fix your broken EA. The restart is not the problem.

  3. Lack of planning on your part does not make an "emercency!!" on our part.