Questions from a "dummy" - page 214

 
G001 I just need to check programmatically when it stops working in order to restart before the next signal.

OK, let's assume that the expert really isn't working. It's frozen, sort of. In that case, I would try to use custom events, namely:

1) from the EA itself I would send a custom event to the chart with a certain periodicity (by timer or by the arrival of a new tick);

2) create a second EA of a simpler type that would only accept this custom event and check if a certain period (e.g. 1 or 10 minutes) has passed since the last event. If the delay exceeds the permissible interval, the second EA will issue an alert.

This way you can visually see the warning and manually restart the terminal.

 
G001:
Thanks. It is unlikely that the problem is in the Expert Advisor, otherwise the rule of restarting the terminal would not always work. Besides, this problem is also in MT4 with some brokers. I just need to check programmatically when it stops working to restart before the next signal. Added both prints and comments.

Why is it unlikely? )) Quite likely. Sometimes one's own mistakes are very hard to catch. And when you find them, you think: "How come you didn't notice what was under your nose before? ))

 
Yedelkin:

OK, let's assume that the expert really isn't working. It's frozen, sort of. In that case, I would try to use custom events, namely:

1) from the EA itself I would send a custom event to the chart with a certain periodicity (by timer or by the arrival of a new tick);

2) create a second EA of a simpler type that would only accept this custom event and check if a certain period (e.g. 1 or 10 minutes) has passed since the last event. If the delay exceeds the permissible interval, the second EA will issue an alert.

This way it will be possible to visually see the warning and manually restart the terminal.

Was hoping there was something simpler. Thank you.
 
tol64:

Why is it unlikely? )) Quite likely. Sometimes one's own mistakes are very hard to catch. And when you find them, you think: "How come you didn't notice what was under your nose before? ))

Suppose there's even a problem in the Expert Advisor, even though there are no errors in the log. The question is not about that, but how to check whether it works or not, if it is green and there are no errors in the log.
 
G001: I was hoping it would be simpler. Thanks for that.

That's easy. A couple of new lines in the main EA, and five lines in the second EA to check for delays and alerts.

Maybe there is an easier way, but people are still not talking :)

 
Yedelkin:

That's easy. A couple of new lines in the main EA, and five lines in the second EA to check the delay and voila.

Maybe there are simpler ones, but people aren't talking yet :)

I will do so, the EA will generate an alert every n minutes. When alerts will stop it will mean that it stopped working. Is it ok?
 
G001: I will do so, the Expert Advisor will generate an alert every n minutes. When the alerts stop, it means that it has stopped working. Is it good?

Yeah, that's fine too. As long as you don't get annoyed by these occasional messages. In my version, it's enough to get one message to be annoyed :)

You can even try to connect a sound file - but this is an amateur.

 
Yedelkin:

Yeah, that's fine too. As long as you don't get annoyed by these occasional messages. In my version, however, it's enough to get one message to get stressed :)

You can even try to connect a sound file - but this is an amateur.

Your version is better, but perhaps the second EA will also stop working.

I think the problem is either in the terminal or in the broker's hands. That's why I added it:

void OnTick()
{
  Comment(TimeToString(TimeLocal(),TIME_MINUTES|TIME_SECONDS));

I will know and what time it goes to sleep.

Thank you all.

 
G001: Thank you all.
Let me know how it turns out. Interesting :)
 
Yedelkin:
Let me know how it turns out. Interesting :)
Usually in such cases it ends up with a change of broker. But now he has to survive under such conditions, until there are more brokers with real account in MT5. I will post a screenshot when he falls asleep again. :)
Reason: