MT5 and speed in action - page 92

 
fxsaber:

Monitor the discrepancy between TimeLocal and TimeCurrent.

And if TimeLocal() will lag in these situations, is the cause in the operating system?
 
Vasiliy Pushkaryov:
And if TimeLocal() will lag behind in such situations, is the cause in the operating system?

TimeLocal is not far behind. The discrepancy is a broker.

 
Vasiliy Pushkaryov:

Maybe someone has experienced, what can be the reason for such hiccups or brakes?

The first thing that comes to mind is a bug in the code that causes the calculation to run for a very long time (e.g. in the cycle from 1 to 10 the whole int is run because of the bug)

 
fxsaber:

TimeLocal is not far behind. The discrepancy is a broker.

Thank you. I'll give it a try.
 
Andrei Trukhanovich:

The first thing that comes to mind is a bug in the code that triggers a calculation that takes a very long time (for example, in the cycle from 1 to 10 the whole int is run because of the bug).

It is written in the help that a looped EA cannot disrupt work of other programs. Everything freezes and then starts working again.

I have 7 MT4 terminals and three MT5 terminals running in parallel. Maybe there is not enough capacity?



 
Vasiliy Pushkaryov:

It seems to be written in the help that a looped EA cannot disrupt other programmes. And here everything freezes, then everything starts working again.

Yeah, strange, I only saw the experts tab, I didn't see the logs the first time.

There are 7 MT4 terminals and three MT5 terminals running in parallel. May be there is not enough capacity ?

If so, then most likely all the terminals would be slowed down. Plus CPU load should just scale to 100% in this case

 

The set TerminalA - terminals which have ping data(xxx ms) to access points.

The set TerminalB - terminals which have no ping data(n/a) to access points.


Terminals from both sets can be connected to the same Access Point and trade in the same way - OrderSend is sent and responses are received.


TerminalA loads the processor as little as possible.


TerminalB:

  • loads the CPU as much as possible.
  • after rebooting remains TerminalB.
  • After "Rescan network" (manually via GUI) changes type to TerminalA. Accordingly, it stops loading the CPU.


If you encounter inexplicably high CPU load, try rescanning. This helped me to change all TerminalB to TerminalA.

 

I don't know why, but my broker seems to have more trading turnover, number of trades and number of active trading accounts on MT5 than on MT4.

Unfortunately, there is only aggregate information by platform.

Количество закрытых позиций :129 714
Торговый оборот ($) :$ 5 747 296 372
Активных счетов :498

But circumstantial evidence suggests that MT5 is ahead of MT4. The reasons for this state of affairs are only to be guessed at.


What I know about clients:

  • >95% of trades (~99% of turnover) are auto-trading.
  • Some clients have MT5 terminal eating up > 10 gigs of memory (historical caches), MT4 at the same volume < 1 gig. In spite of this, are ready to overpay for more powerful VPS, but trade exactly on MT5, and not on 4.
  • Almost all of them are scalpers. Main profit is accounted for evening and night flat trading.
  • The high activity (to the plus side compared to other brokers) during the rollover period - huge spreads.
 
fxsaber TimeCurrent.

Thanks for the tip. Caught this situation. In OnTimer() monitored the discrepancy between TimeLocal() and TimeCurrent()


Since yesterday evening at 21:58 TimeCurrent() started returning the same time. Released today at 00:08. I.e. just over two hours had this situation from all characters.

 

Not a remote machine (not VPS) with good specs and a ping to the trading server <4ms saw many cases of regular lags when viewing Terminal logs (b2958).


Took the first one I saw for demonstration here.

2022.01.18 23:00:09.375  Trades  '': modify order #7133346 sell limit 0.23 USDCHF at 0.91744 sl: 0.00000 tp: 0.91709 -> 0.91741, sl: 0.00000 tp: 0.91709
2022.01.18 23:00:17.752  Trades  '': accepted modify order #7133346 sell limit 0.23 USDCHF at 0.91741 sl: 0.00000 tp: 0.91709 -> 0.91741, sl: 0.00000 tp: 0.91709
2022.01.18 23:00:17.769  Trades  '': modify #7133346 sell limit 0.23 USDCHF -> price: 0.91741, sl: 0.00000, tp: 0.91709) done in 8393.712 ms


The limiter modification lasted eight seconds. Most modifications take about that amount of time.

2022.01.18 23:11:00.751 Trades  '': modify #7133346 sell 0.23 USDCHF sl: 0.00000, tp: 0.91711 -> sl: 0.00000, tp: 0.91712
2022.01.18 23:11:00.761 Trades  '': accepted modify #7133346 sell 0.23 USDCHF sl: 0.00000, tp: 0.91711 -> sl: 0.00000, tp: 0.91712
2022.01.18 23:11:00.763 Trades  '': modify #7133346 sell 0.23 USDCHF -> sl: 0.00000, tp: 0.91712 done in 12.422 ms


Even for a 4ms ping it's a lot, but still nothing compared to eight seconds.


Only MT5 terminals are running on this machine and the average CPU load is ~1%. Analysis has shown that during braking the load spikes up to 100% when the market and trade orders are very active. As a result, it takes a VERY long time to receive response from the trade server to the terminal. In the case of slowness I have asked the broker for information. On the trade server side everything is instantaneous and the order reaches the server from the terminal on the first line. I.e. order sending does not slow down, lags happen when receiving reply to the terminal.


I doubt that developers will be able to improve anything here. Who is VERY active in trading, please share your observations on this topic with your logs.