Subject: MT5 Automatic Server Switching, Temporary Broker Disconnections, and Potential Impact on Expert Advisors (EAs)
Subject: MT5 Automatic Server Switching, Temporary Broker Disconnections, and Potential Impact on Expert Advisors (EAs)
all of the issues you describe do happen every day, but all of the effects are minimised, managed and even often wiped out by competent coding OR the trader getting a better internet connection. The thing with trading is that you learn that there will always be another signal in the future, so you learn to live with "these things"; but mostly by learning to avoid them by coding better yourself.
The one you did not mention that causes most complaints on the forum is when forced mt4/5 updates are pushed on both traders and brokers.
missed ticks or missed bars only cause issues if the coding of the ea is inadequate to handle those times.
I recommend the mql5 vps for its convenience, but if you have more than 1 trading account or need dlls, then its not for you.
i doubt you will get many other responses due to your op being so long winded. most readers dont read beyond 2 paras.
I would separate what sits on the server from what sits in your terminal, because that decides what a short disconnect can hurt. A stop loss or take profit the server has already accepted stays active while your terminal is offline, and the server executes it without your EA. What pauses is everything your EA computes. A trailing stop only moves while the EA runs and has a connection, so during a gap the last stop you sent is the one protecting you.
Ticks that arrive while you are disconnected are not replayed into OnTick afterwards, so a crossover that appears and vanishes inside the gap is never seen there. The server keeps the tick history, so after reconnecting you can request the missing interval with CopyTicksRange and evaluate it, or base the signal on closed bars so a gap cannot hide it. I also run the logic from a one second timer next to OnTick, check TerminalInfoInteger(TERMINAL_CONNECTED) there, and after a reconnect recompute the trailing level from the current price before sending anything. A gap of a few seconds then only delays the adjustment.
Subject: MT5 Automatic Server Switching, Temporary Broker Disconnections, and Potential Impact on Expert Advisors (EAs)
Hello,
I use MetaTrader 5 with an Expert Advisor (EA) that operates on real-time ticks rather than waiting for candle closes.
I have noticed that MT5 can automatically switch to another broker access point when it detects a better connection quality. This automatic switching can cause temporary disconnections from the broker, even when the VPS itself is operating normally.
I am concerned that these interruptions could affect not only my EA, but potentially many other EAs that rely on real-time tick processing, causing missed trading signals, missed trades, delayed Stop Loss adjustments, and potentially financial losses.
I would like clarification on the following points.
1. Automatic server switching and broker disconnections
When MT5 automatically switches to a broker server or access point offering better connection quality, can this process interrupt the connection for a fraction of a second or several seconds?
Is this behaviour normal and unavoidable in MT5?
Does MT5 consider the potential impact of these interruptions on running Expert Advisors?
Can users disable automatic switching or control when this process occurs?
2. Impact on EA trading signals and missed trades
If MT5 loses its connection to the broker for a few seconds while the terminal remains open:
Are tick events occurring during the disconnection permanently lost?
When the connection is restored, does MT5 send missed tick events to the EA, or does it only provide new incoming quotes?
If a moving average crossover (WMA) occurs during the disconnection and disappears before reconnection, can the EA detect or recover that missed crossover?
Could this result in a missed entry, missed exit, or delayed reversal, potentially causing financial losses?
3. Trailing Stop functionality
If the trailing stop is calculated by the EA using a moving average:
Does the EA continue calculating the trailing stop while MT5 is disconnected from the broker?
When the connection is restored, can the EA immediately recalculate the Stop Loss using the current moving average value?
Can it immediately send an updated Stop Loss to the broker, even if several ticks were missed?
Does the last Stop Loss successfully transmitted to the broker remain active throughout the disconnection?
4. MQL5 VPS versus external VPS providers
Does the behaviour differ when an EA runs on MQL5 Virtual Hosting rather than on an external VPS provider?
Would MQL5 VPS prevent or reduce these interruptions, or can the same automatic broker-server switching and missed tick events occur?
My main concern:
MT5 appears to prioritize finding the best connection quality by automatically switching broker access points. However, these switches can temporarily interrupt communication with the broker.
For EAs that depend on real-time price movements, even a very short interruption could mean missing a crossover signal or delaying a trailing Stop Loss adjustment. This could affect many MT5 users and potentially result in missed trades and financial losses.
I would appreciate a clear technical explanation of how MT5 handles these situations, what safeguards are available, and whether users can prevent or minimize these interruptions.
Thank you.