Has anyone seen the MT5 terminal fail to receive trade confirmation while the broker's server shows the position opened?
No, I have not.
What logs/timestamps should I collect and send to the broker to speed up diagnosis?
Go to MT5==>File==>Open Data Folder==>logs.
Any mitigation (EA patterns or terminal settings) to avoid or detect this desync automatically?
My live broker-dealer's latest Release of MT5 is Build 5430.
There are latency detection utilities on mql5.com.
Edit: In the Forum actually (use the Forum's Translate feature):
Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий
Номинальная скорость обработки ордеров - МТ4 vs МТ5. Тестируем вместе.
Renat Fatkhullin, 2012.04.30 13:48
Вот мои результаты тестов по сети из Лимассола до Амстердама, пинг до MetaQuotes-Demo серверов на уровне 130 мс.
Тесты на MetaTrader 5 build 642:
2012.04.30 14:09:40 MQL5TradeSpeed.Sync.vs.Async (EURUSD,H1) 4. Открытие 10 сделок асинхронно заняло 31 ms, 3 ms на сделку, 0 ошибок 2012.04.30 14:09:40 MQL5TradeSpeed.Sync.vs.Async (EURUSD,H1) 3. Открытие 10 сделок асинхронно, подождите... 2012.04.30 14:09:40 MQL5TradeSpeed.Sync.vs.Async (EURUSD,H1) 2. Открытие 10 сделок синхронно заняло 1498 ms, 149 ms на сделку, 0 ошибок 2012.04.30 14:09:38 MQL5TradeSpeed.Sync.vs.Async (EURUSD,H1) 1. Открытие 10 сделок синхронно, подождите...
Тесты МetaTrader 4 build 419:
2012.04.30 14:19:33 MQL4.TradeSpeed.Sync EURUSD,H1: Alert: 2. Открытие 10 сделок синхронно заняло 2075 ms, 207 ms на сделку, 0 ошибок 2012.04.30 14:19:31 MQL4.TradeSpeed.Sync EURUSD,H1: Alert: 1. Открытие 10 сделок синхронно, подождите...
Видно, что 10 сделок на MetaTrader 5 в асинхронном режиме улетели за 31 мс, в среднем по 3 мс на ордер. Это скорострельность асинхронного режима "выстрелил и забыл" без какого либо подтверждения со стороны сервера. Первые ответы (пачкой) от сервера придут где-то через 145 мс, как в обычном синхронном режиме. Но как 10 заявок были выстрелены за 31 мс, так и прием их результатов тоже должен прийти пачкой через 145 мс.
Синхронный режим показывает по 149 мс исполнения каждой заявки, что при базовом пинге до торгового сервера в 130 мс является хорошим результатом. Маленький размер сетевого пакета + эффективный сетевой протокол позволяют очень быстро доставлять данные.
В MetaTrader 4 есть только синхронный режим и среднее время исполнения одной заявки оказалось 207 мс, что больше времени исполнения MetaTrader 5. Одним из объяснений этой разницы является затраты на использование отдельного сетевого контекста для торговых операций, что может привести к некоторым задержкам. Кроме того, в MetaTrader 5 мы применили более эффективные механизмы очередей заявок и исполнения.
Важно помнить, что любые замеры скоростных сетевых характеристик прямо зависят от самой сети. В моем случае базовый пинг до MetaQuotes-Demo серверов был на уровне 130 мс. Это означает, что нельзя сравнивать получаемые результаты между разными замерами без применения учета и коррекции на базовый пинг.
Я приложил два скрипта, чтобы любой мог провести собственные тесты. Используйте их на одинаковых MT4/MT5 серверах, стоящих в одном и том же физическом месте, с одинаковыми точками доступа и с одинаковыми величинами пингов. Это позволит сравнивать полученные результаты в режиме MT4 vs MT5. Адреса наших демонстрационных торговых серверов MetaTrader 4 (demo.metaquotes.net:443) и MetaTrader 5 (access.metatrader5.com:443).
No, I have not.
Go to MT5==>File==>Open Data Folder==>logs.
My live broker-dealer's latest Release of MT5 is Build 5430.
There are latency detection utilities on mql5.com.
Edit: In the Forum actually (use the Forum's Translate feature):
Latency detection should be useful, I'll look into it.
Switching from Synchronous order sending to Async may be beneficial as well.
I'll have to study how to do it.
Do you know if MQL5 provides any method to get position information direct with the broker's server?
Today we use a method to collect position data such as in:
struct Position { string symbol; int magic; long type; long time; ulong ticket; double volume; double profit; double my_sl; double my_tp; double curr_price; double open_price; }; ... Position GetCurrentPosition() { Position current_position = {}; int total_positions = PositionsTotal(); for (int i = 0; i < total_positions; i++) { ulong ticket = PositionGetTicket(i); if (PositionSelectByTicket(ticket)) { if (PositionGetString(POSITION_SYMBOL) == _Symbol && PositionGetInteger(POSITION_MAGIC) == magic_number) { current_position.symbol = PositionGetString(POSITION_SYMBOL); current_position.magic = PositionGetInteger(POSITION_MAGIC); current_position.type = PositionGetInteger(POSITION_TYPE); current_position.time = PositionGetInteger(POSITION_TIME); current_position.ticket = PositionGetInteger(POSITION_TICKET); current_position.volume = PositionGetDouble(POSITION_VOLUME); current_position.profit = PositionGetDouble(POSITION_PROFIT); current_position.my_sl = PositionGetDouble(POSITION_SL); current_position.my_tp = PositionGetDouble(POSITION_TP); current_position.curr_price = PositionGetDouble(POSITION_PRICE_CURRENT); current_position.open_price = PositionGetDouble(POSITION_PRICE_OPEN); return current_position; } } } return current_position; }
Regards!
Do you know if MQL5 provides any method to get position information direct with the broker's server?
No. My understanding is that MQL5 limits user access to position data in said user's trading account.
You might be able to get a higher resolution of trade execution details by calling deal history--especially if you have a Netting account. but that would simply be more information from within your account.
In the U.S., we have something called a Transaction Data Report which gives traders the right to manually inspect their broker-dealer's trade execution log. We just request it, and the broker-dealer must comply within a half hour. I should note that this can anger a low-tech broker-dealer because they have to manually pull the execution logs. In contrast, a transparent hi-tech broker-dealer will have an automated response system in place--and generally even advertise our right to request TDR's. This is important because virtually every broker-dealer has terms that entitle it to terminate any account without cause.
I have no idea about Brazil because I haven't researched it. Perhaps there is something similar.order #282341555 buy 20 / 20 WINZ25 at market done in 158785.980 ms (|{INTRADAY}|)
You need to talk with your broker. This 158 seconds is enough information for them to provide you answers about it.
I did some research. It appears that you're entitled to broker-dealer information in Brazil where OTC products are deemed to be securities:
"Access to appropriate information
Ensure public access to information on securities traded and the companies that issued them, regulating the Law and administering the registration system for issuers, distribution and regulated agents (Law 6.385/76, art. 4, item VI, and art. 8, items I and II)."
- Frequency: First clients to execute have low latency, and it scales up to 180, where they start to get timeout responses (and thus, desync).
Please, clarify this paragraph. Do you run up to 180 simultaneous connections for the same account?
Please, clarify this paragraph. Do you run up to 180 simultaneous connections for the same account?
Checking execution logs I can see orders being concluded (order [type] at market done in [x] ms)
Value of x increases from around 150ms up to 180s (where they start to recieve Request timeout) for each individual client.
How much VPS instances are used for these 200+ clients? Do they probably share the same IP?
Can it be that the broker punishes/slows down your actions intentionally, if you exceed some limit (probably) specified in trade conditions?
No, we run the same EA in 200+ clients.
Checking execution logs I can see orders being concluded (order [type] at market done in [x] ms)
Value of x increases from around 150ms up to 180s (where they start to recieve Request timeout) for each individual client.
Oh, I see. This is a horse of a different color.
This is the functional equivalent of a distributed high frequency trading strategy. Most broker-dealers expressly prohibit HFT. Definitely check with your broker-dealer... assuming that you even want to confess this to them.
How much VPS instances are used for these 200+ clients? Do they probably share the same IP?
Can it be that the broker punishes/slows down your actions intentionally, if you exceed some limit (probably) specified in trade conditions?
System averages 7 clients per VPS.
Orders are sent from across all clients inside a time space of 10 seconds.
Forum on trading, automated trading systems and testing trading strategies
Stanislav Korotky, 2025.12.02 16:28
if you exceed some limit (probably) specified in trade conditions?
Where would that limit be specified?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello fellow traders!
I'm experiencing intermittent and severe issues with my broker's Trade Server that cause the client terminal (MT5) to desynchronize from the server.
Symptom example (broker log):
order #282341555 buy 20 / 20 WINZ25 at market done in 158785.980 ms (|{INTRADAY}|)
Yes — 158,786 ms (≈158 seconds) execution latency.
More seriously, there are cases where:
Additional context:
Questions and checks I want help with: