How is TerminalInfoInteger(TERMINAL_PING_LAST) in mt5 treated to detect net interruptions.

To add comments, please log in or register
Carl Schreiber
Moderator
7068
Carl Schreiber  

Hi,

I am still using mt4 and I tried to use TerminalInfoInteger(TERMINAL_PING_LAST) to detect net failures.

Sometimes it works:


But sometimes it doesn't! :(

Obviously the ping is executed in another thread than eas and indis (at east in mt4) it cannot be used to detect net failures despite it would be really helpful and easy to use if it were working reliably.

My question now is: does mt5 shows the same behaviour so that even in mt5 the ping cannot be used to detect net-failures to be able to react on that (checks, ..).

Maybe s.o. can convert and run the attached indi on a mt5 and unplug the internet for a couple of minutes several times?

Files:
Nguyen Nga
14294
Nguyen Nga  
I think you need put code into OnTimer().
Carl Schreiber
Moderator
7068
Carl Schreiber  
Nguyen Nga:
I think you need put code into OnTimer().

If it would be coded smartly there would be no need for that!

But Metaquotes just did not think about this kind of use as the ping seems to be used only for the best connection to one of the servers!

whroeder1
17945
whroeder1  
Carl Schreiber: If it would be coded smartly there would be no need for that!
If you have a disconnection, OnCalculate will not run. Once it does, you've already missed the problem and are reconnected. Must run in OnTimer, or your results are meaningless.
Carl Schreiber
Moderator
7068
Carl Schreiber  
whroeder1:
If you have a disconnection, OnCalculate will not run. Once it does, you've already missed the problem and are reconnected. Must run in OnTimer, or your results are meaningless.

No, one do not have to run OnTimer()!

You can run OnCalculate() and check the time between the ticks or the moments OnCalculate() runs and increase of the amount of ticks.

As an alternative the ping would work if it were coded within the terminal in a smart way!

But my question was how is this ping coded in mt5! The same was as in the mt4?

To add comments, please log in or register