MT4 C++ Dll speed issue

 

Hi,

I am using a VPS, running win 2008 server with 2 gig of ram, and 2 x 2.4 ghz processors. I have written a C++ Dll that uses windows sockets to communicate with my software and passes instructions to MT4 EA via Functions. I have proved that my DLL gets its instructions in less than 1 millisecond and sets its variables within 1 millisecond no mater how many MT4's are loaded. If I load up to three MT4's the EA gets its instructions in less than 1 millisecond, but as I add MT4's this deteriorates, up to 240 milliseconds when running 10 MT4's. The processors are running at under 40% and the Physical memory less than 50%. There is no consistency in the delays they can range from 64 milliseconds to over 200, although they all seem to be multiples of 16.

I have tried written a different DLL for each MT4 with different Function names, this appears to have made no difference. to measure my timespan I am using GetTickCount.

Speed is very important to my trading, every millisecond counts as I am a news trader. As well as trading Multiple brokers I have found that smaller lot sizes help in reducing slippage, this means that i really need to have multiple accounts with multiple brokers. So limiting my self to 3 MT4's per server will be very costly.

Has anyone come across this before, does anyone have any ideas?

 
Bremsford:

[...] although they all seem to be multiples of 16.

It sounds as though you are using GetTickCount() to do the timings. This is a wrapper around Windows's own GetTickCount() function, whose accuracy is limited: http://msdn.microsoft.com/en-us/library/ms724408(v=vs.85).aspx.

I suggest that you start by using something like 7bit's suggestion in https://www.mql5.com/en/forum/126497. The log in DbgView will give you much more accurate timings. It isn't going to solve your fundamental problem, but it will give you a better idea of how big the problem is. At the moment what you actually know is that delivery at best takes less than 16 milliseconds, not that it takes less than 1 millisecond.

 
Thanks jjc, I am looking now :-)
 

Sounds to me like the delay is related to the network. receiving 10 packets take 10 times longer.

Why do you need 10 mt4s. when each terminal can support dozens of pairs/TF combo?

 
And why are you using MetaTrader at all instead of some professional trading platform / API when you are moving such vast amounts of money that 3 different brokers together are not enough to handle it all?
 
And do you have a dedicated machine on that VPS or just an account amongst many other accounts from other people on the same terminal server cluster?