how to 'sleep' the EA during weekend close period

 

Hi,

I am just worried that the EA I coded might bombed the broker server with open or close order requests when the order request fails because the market is closed for the weekend.

How do you handle this? How do you safely put your EA to sleep (until the market opens) even if you are in a signal to 'close order now' or 'open an order' now as per your strategy?

e.g. wait for next tick? handle error 134? etc.?

I am hoping for your comments.

 

Not necesarly to sleep EA because the start() function are execute when the platform recive a new quotes.


....From mql4help


At incoming of new quotes, the start() function of the attached experts and custom indicators will be executed. If the start() function launched at the preceding quote was running when a new quote came, the new quote will be skipped by the expert. All new quotes income while the program was being executed are skipped by the program until the current execution of the start() function has been completed. After that, the start() function will be run only when a successive new quote incomes. For custom indicators, the start() function will be launched for recalculation after the current chart symbol or timeframe has been changed independently on new quotes incoming. The start() function will not be run when the expert properties window is open. The latter cannot be opened during the expert execution.

Reason: