Download MetaTrader 5
To add comments, please log in or register
How to buy a product in MetaTrader AppStore? Read the article!
Carl Schreiber
5934
Carl Schreiber 2012.05.12 16: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

Jon Grah
367
Jon Grah 2015.03.09 15:12  
No one was able to figure this out?
whroeder1
13596
whroeder1 2015.03.09 16: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?
/
To add comments, please log in or register