HowTo change Server (rescan and new connect/login) by an EA?

Back to topics list To post a new topic, please log in or register
avatar
2017
gooly 2012.05.12 18:07
 

Hi,

is that possible and how can it be done, that an EA checks 1) the latency to an server

  1. check the latency of its actual server mybe just by

    beg = GetTickCount();
    ord = OrdersTotal();
    latency = GetTickCount() - beg;
  2. decides: this os ok - do nothing
  3. decides: too big check for a better one
    // disconnect the actual server
    void disconn() { ?? }
    // scan for the other maybe from a list?
    string scanForBetterServer() { ?? }
    // re-connect
    void reconn (string betterServer) { .. }

Does anbody has an idea how this can be programmed within an EA?

Thanks in advance,

Gooly




 
avatar
249
4evermaat 2015.03.09 16:12 #
 
No one was able to figure this out?
avatar
12983
WHRoeder 2015.03.09 17:29 #
 
  1. beg = GetTickCount();
    ord = OrdersTotal();
    latency = GetTickCount() - beg;
    OrdersTotal is not a server call. All it does is read a variable out of the terminal. Won't work.
  2. EA periodically restart the terminal Terminal auto restart. - MQL4 forum replace the call to CloseTerminal with new terminalclose
  3. You're not co-located with the broker's server so latency is unavoidable so why do you care?
Back to topics list  

To add comments, please log in or register