Latency for trading

 
Hello everyone, I am running a python code to trade on mt5 IC markets and Fusion Markets. I want to know what should I do, where to run the code to have the least latency, currently running the code in equinix NY, where they both have a server but still its slow. It shows 0.5ms in the bottom right of MT5 but enters a trade(when I see it in journal) its 40ms instead of 0.5ms
Also when I subscribe to VPS, and its said to have 1ms latency, and my server has20ms latency, wouldnt it be 20+1=21ms latency?
so from my server to the vps and fromvps to the server
I need the least latency I can get, please advice.
 
How do you ensure your Python code is optimized for low-latency execution?

Do you use wired connection or Wi-Fi?
 
Oleksandr Medviediev #:
How do you ensure your Python code is optimized for low-latency execution?

Do you use wired connection or Wi-Fi?
I have my server in equinix data center so its wired.
 

I wouldn't call myself an expert on this topic. But as far as I know, ping and order execution time by a broker are 2 different things. That is, you may have a ping < 20 ms, but when the broker receives your trade order, it can execute it for several hundred ms (and this does not depend on your ping). That is, if I understand correctly, the total execution time of a trade order should be equal to ping + execution time already on the broker’s server.

I cannot answer your question and cannot advise you anything. I just wrote my thoughts. I could be wrong.

 

Imagine that you want to drink a cocktail while sitting at the bar counter. If you get to the bar in 20 seconds, it doesn't mean you'll start drinking a cocktail in 20 seconds - the bartender needs time to make your cocktail.

Erik Shekunts:
It shows 0.5ms in the bottom right of MT5 but enters a trade(when I see it in journal) its 40ms instead of 0.5ms

It's quite possible that you got to the bar in 0.5ms, and the bartender took 40ms to make a cocktail

 
Vladislav Boyko #:

Imagine that you want to drink a cocktail while sitting at the bar counter. If you get to the bar in 20 seconds, it doesn't mean you'll start drinking a cocktail in 20 seconds - the bartender needs time to make your cocktail.

It's quite possible that you got to the bar in 0.5ms, and the bartender took 40ms to make a cocktail

Thank you very much, I understand now!
 
Vladislav Boyko #: you may have a ping < 20 ms, but when the broker receives your trade order, it can execute it for several hundred ms (and this does not depend on your ping).

Exactly. Worse is during news; platform is irrelevant. Network is irrelevant.

The microseconds the EA takes is irrelevant, compared to the 20-200 milliseconds the network takes, which is irrelevant compared to the minutes to do a trade because of the servers during news.

OrderSend sends the request, network delivers, placed in the server queue. Once it reaches the top of the queue, you get filled or not, and the result delivered back to the terminal. Normally it is the 20-200 milliseconds the network takes to deliver is the limiting factor, but it can take minutes to do a trade because of the servers during news.

Reason: