Arbitrage between two brokers often means one terminal is MT4 and the other MT5, or two MT5 terminals. They cannot see each other's prices directly, so they need a bridge. This article explains how that bridge works, what makes it dependable, and what to prepare before you ask for one.
Why a bridge is needed
Each MetaTrader terminal is a separate program with its own broker connection. An EA inside one terminal only sees that broker's quotes and can only trade on that account. Arbitrage needs both prices in one place and the ability to trade both accounts at once. A bridge solves that by letting the two terminals talk to each other.
How the bridge works
- A small program or EA in each terminal sends its prices to the other over a local TCP connection.
- One side calculates the gap and sends the trade command.
- Both terminals open their leg at almost the same moment.
When both terminals run on the same machine, the messages travel inside the computer, so the delay between legs can be very small. Which side makes the decisions is a design choice. Usually one terminal acts as the master that holds the logic, and the other acts as a follower that executes commands and reports back.
What makes it reliable
- Running both terminals on the same fast VPS.
- Checking that both legs filled, and repairing the hedge if one did not.
- Logging every order with timestamps so slippage can be measured.
The second point matters most. If one leg fills and the other is rejected, you hold an unhedged position. A good bridge detects this within moments and either completes the missing leg or closes the filled one, based on rules you set.
Differences between MT4 and MT5
MT4 and MT5 handle some things differently, and the bridge must respect that. MT5 has netting and hedging account types, and MT4 is hedging only. Order functions, position handling and symbol properties are not the same. Contract sizes, tick values and lot steps can differ between brokers even for the same instrument, so the EA must convert lot sizes correctly for each leg.
- Confirm the account type on each side.
- Check symbol names, contract sizes and minimum lots on each broker.
- Compare server time zones and trading hours.
Things to prepare before building
- The instruments and brokers on each side.
- Your entry and exit rules, including how the gap is calculated after spreads and costs.
- What should happen if one leg fails, if the connection drops, or if a terminal restarts.
- Your account types and whether the brokers allow automated trading on them.
How we can help
We build bridge-based arbitrage systems, dashboards and monitoring tools. See arbitrage systems for the full scope. Arbitrage projects start at Rs 25,000 and typically take 1 to 4 weeks, as shown on the pricing page. Payment is 50% in advance and the balance on delivery, and we show a working demo before final payment. If you want to understand the statistical side first, read about Z-score arbitrage, and for hosting see the VPS setup checklist.
Monitoring and logging
A two-terminal system has more moving parts than a normal EA, so it needs good visibility. Each order should be logged with the time it was requested, the time it was confirmed, the requested price and the fill price. From these logs you can see the real delay between legs and the real slippage, instead of guessing. If the numbers get worse, you know to look at the VPS, the connection or the broker.
- Show the connection state of the bridge on the chart.
- Alert you by Telegram or email if prices stop arriving.
- Pause new trades automatically when the bridge is down or the price feed is stale.
- Keep a daily log file so a problem can be traced afterward.
Stale prices are a quiet danger. If one terminal stops receiving quotes but the bridge still shows the last value, the EA may believe a gap exists when it does not. A time check on every price message, with a limit on how old a price may be, prevents trades on old data.
Frequently asked questions
Can MT4 and MT5 EAs talk to each other?
Not directly, but a small connection layer, for example a local TCP socket, lets them exchange prices and commands. Both terminals need that component installed.
Do both terminals need to be on the same computer?
It is the most common and simplest setup because it keeps the delay low. Other layouts are possible but add network delay and more points of failure.
What if one leg does not fill?
The EA should detect it quickly and follow a rule you choose, such as retrying the missing leg or closing the filled one. We define this behavior with you before building.