Closed KptKuck closed 5 years ago
On this Picture can see the issue
I have now added the event myself. Unfortunately, it does not work anyway. Because the sleep function in DeInit does not work. It is a limitation of MQL5. Look here
I have to find another way to send the event. It would make sense to send it before. A few seconds is enough.
ive created a workaround. That works vor me, but this problem is not solved. closing this issue
I am still having trouble processing a correct end of the tester in Matlab. The evaluation of the connection state always ends in a .Net exception. Apparently the status is updated too slowly.
Is it possible to introduce an event "TesterDeInit"?
About as:
(file mtapi5.mq5)
void OnDeinit(const int reason) { MtDeInitEvent* deinit = new MtDeInitEvent(status); SendMtEvent(LAST_BAR_REACHED_DEINIT); delete deinit; Sleep(1000); // necessary for correct detection deinit(); }
does anyone have similar problems?
Ps: I start the MT5 over the commandline with config and he ends himself. That may explain the problem better. Why am I doing this? I use automatic tests with several MT5 instances. Matlab opens one, performs a test and then the MT5 closes again. So I can use 4 testers in parallel.