[...] My solution is to send bogus BUY/SELL commands every 25 seconds, so that the MT4 command connection is not disconnected, but that's not optimal. [...]
That would probably make your broker block automatic trading on your account (yes, they can do that).
[...] and disconnects after 30 seconds inactivity.
I have never noticed that. You sure u got your facts right?
That would probably make your broker block automatic trading on your account (yes, they can do that).
[...]My solution is to send bogus BUY/SELL commands every 25 seconds, so that the MT4 command connection is not disconnected, but that's not optimal.
[...]
i think the damage is more than the benefit u gonna pay every 25 sec. spread for nothing
then i think he don't have to worry for blocking the account (& maybe he can just send another code to keep alive the connection like some MarketInfo())
then i think he don't have to worry for blocking the account (& maybe he can just send another code to keep alive the connection like some MarketInfo())
u know what changing the history, for example from last week to monthly does need the servers connection & no need to worry for account blocking (but involving WIN API)
u know what changing the history, for example from last week to monthly does need the servers connection
Hi,
I'm developing a scalper and low execution latency is very important for me when trade is executed.
The problem is that MT4 has a one TCP/IP connection for price feed, that is always connected.
However the connection to the server for executing BUY/SELL commands is connected on first use bases and disconnects after 30 seconds inactivity.
So If I send BUY command, it takes about 700ms just to establish the TCP/IP connection to the server. This time takes to exchange the SYN TCP/IP packets and establish the SSL protocol.
My solution is to send bogus BUY/SELL commands every 25 seconds, so that the MT4 command connection is not disconnected, but that's not optimal.
So my question is: is there a secret setting to keep alive the connection for more than 30 seconds?
Thanks!
If you dont want to open a bogus order maybe you could send an orderclose every 30 seconds for an order with a ticket number that doesnt exist.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I'm developing a scalper and low execution latency is very important for me when trade is executed.
The problem is that MT4 has a one TCP/IP connection for price feed, that is always connected.
However the connection to the server for executing BUY/SELL commands is connected on first use bases and disconnects after 30 seconds inactivity.
So If I send BUY command, it takes about 700ms just to establish the TCP/IP connection to the server. This time takes to exchange the SYN TCP/IP packets and establish the SSL protocol.
My solution is to send bogus BUY/SELL commands every 25 seconds, so that the MT4 command connection is not disconnected, but that's not optimal.
So my question is: is there a secret setting to keep alive the connection for more than 30 seconds?
Thanks!