Check Internet Connection Status with EA

thread: Check Internet Connection Status with EA

  1. #1
    Junior Member ikombe's Avatar
    17

    Check Internet Connection Status with EA

    Hi all,

    I'm hoping someone will have the ability to help me with this EA I've coded. The EA uses the IsConnected() function to examine the MT4 terminal's connection with the broker's server. It runs in an infinite loop assessing the status every second. The problem is, it currently doesn't discriminate between the broker dropping the relationship, or my ISP dropping the relationship. So I'm wondering is there a way to somehow test my internet connect if IsConnected() returns False, but by looking through the MQL4 documentation it seems that this is beyond the range of MQL4. I was given some hints of something along the lines of pinging a different broker's host , or loading google. This is simple to accomplish manually obviously, but would like to code it into the EA so that it was automated, and additionally for the EA to then be able to ascertain whether it was the broker's connection of my ISP's connection.

    Any ideas?

    Thanks
    https://www.cliqforex.com/attachment...2045688932.mq4

  2. #2
    Junior Member ikombe's Avatar
    17
    This indior definetly checks for the BROKER connection.
    No, it just uses the IsConnected() function, which doesn't discriminate between the broker dropping the connection or my ISP dropping the relationship, thanks anyway though

  3. #3
    You could use wininet.dll:

    #import wininet.dll
    InternetOpen();
    InternetCheckConnection();
    InternetCloseHandle();

    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    Ex:
    https://www.cliqforex.com/trading-sy...ips-split.html
    or check out the ffcal news indior

  4. #4
    Junior Member ikombe's Avatar
    17
    Thank You a lot for all that Information Xaphod! I will look into all that now

  5. #5
    Junior Member jgj003's Avatar
    10
    This indior definetly checks for your own BROKER connection.
    https://www.cliqforex.com/attachment...7591761947.mq4

  6. #6
    Hi rooicol,

    would you mind sharing if/how you resolved this ultimately.

    Cheers

    Ati

    PS: I only looked through the Majority of your threads: excellent ideas/code you posted

  7. #7
    Hi rooi,
    are you so kind and contact me concerning the Trade-Management-EA you've coded for me .
    I believe there may be a bug I have problems to know some feature in the EA.
    I can't contact you through mail because everytime I try it I get a mail-error. Don't understand why.
    Thank you for everything.
    Greeds Zackery

  8. #8
    Member Fuark's Avatar
    41
    Whether you're able to link to google or somewhere using winsock you could see. I do not anticipate it to be quite a easy thing to do correctly, and imagine some fairly creative uses of mql arrays because there aren't any such thing as structs in mql.

  •