svenb: Thanks for the script. It has indeed some problems, an uninitialized variable and the findTrade function that I don't understand, but both can not lead to a crash. So your problem is still unclear. It might be something with your MT4. Can you contact support(at)opgroup.de? They'll look into your configuration and will find out why you have problems.

3DCat: Weekend = 1 can indeed affect merging of bars and thus the frequency of messages. But normally only at the weekend, not during the week. Can you post your script? I'll check it. Weekend = 0 is not for normal trading, only for special tests.