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?
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!
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?