By Nima Dorostkar, Trading Systems Engineer — MT5, FIX & broker software · Updated
MT5 gateway development
One gateway between MT5
and everything else you run.
“MT5 gateway” means two different things, and most brokers need both. A liquidity gateway is built on MetaQuotes' Gateway API and connects MetaTrader 5 to the market: liquidity providers, prime brokers, and price feeds. An API gateway sits in front of the MT5 server and gives your own software — the web trading terminal, mobile apps, the forex CRM, copy trading and prop engines, and AI assistants over MCP — one secure, documented API instead of direct server access.
We build and run both on your infrastructure. Every gateway is tested on a staging MT5 server first, measured hop by hop in production, and designed to fail safe: when an upstream connection drops, it falls back to a safe state and alerts your team instead of blocking trading silently. Not sure which MT5 API does what? Read the MT5 API guide. For the API gateway and the trading terminal on top of it, as built for OPOTRADE, see MT5 Gateway & Trading Terminal.
- Quotes / s18,420
- p99 latency3.8 ms
- Orders / min642
- Uptime · 30d99.99%
Order round-trip latency · last 60 min p50 p99
| Connection | Protocol | Latency | Throughput | Status |
|---|---|---|---|---|
| LP Alpha | FIX 4.4 | 1.2 ms | 6,240/s | Live |
| LP Beta | FIX 4.4 | 2.8 ms | 4,980/s | Recovered |
| Prime broker | FIX 4.4 | 3.1 ms | 3,410/s | Live |
| Price feed | WebSocket | 0.9 ms | 3,790/s | Live |
| MT5 server | Gateway API | 0.4 ms | synced | Live |
| Client apps | REST · WS | 1.6 ms | 2,184 sessions | Live |
- MT5 Gateway API
- MT5 Manager API
- MT5 Web API
- FIX 4.4
- C++
- Go
- WebSocket
- PostgreSQL
- Redis
Live market data
A trading terminal on a real feed.
Every tick below is live.
This is the front end a gateway feeds. Here it is pointed at a public exchange feed, so the prices, candles, order book and trades are real and move as you watch. In a broker deployment the same terminal reads your MT5 gateway instead: your symbols, your spreads, your clients' accounts.
- 24h change
- —
- 24h high
- —
- 24h low
- —
| Symbol | Side | Size | Current | P&L | Close | |
|---|---|---|---|---|---|---|
| Connecting to the market… | ||||||
- Balance
- 25,000.00
- Equity
- 25,000.00
- Margin
- 0.00
- Floating P&L
- +0.00
- One connection. A REST call loads the history; a single WebSocket then streams quotes, candles, depth and trades.
- Batched rendering. Updates arrive many times a second and reach the screen four times a second, so the page stays smooth on a phone.
- Connects when seen. The feed opens only while the terminal is on screen and the tab is visible, and reconnects by itself if the stream drops.
In short
- Nima Dorostkar's team builds MT5 gateways for brokers: Gateway API connectors that link MetaTrader 5 to liquidity providers and price feeds, and API gateways that put a secure REST and WebSocket layer over an MT5 server.
- An MT5 liquidity gateway translates between MetaTrader 5 and a liquidity provider's FIX or REST API, with symbol mapping, markups, price filtering, and execution reports written back into MT5.
- An MT5 API gateway lets web terminals, mobile apps, CRMs, copy trading and prop engines, and AI assistants use MT5 without connecting to the trade server directly.
- The team's MT5 gateway is a ready-built product, deployed on the broker's own servers and adapted to its liquidity providers, symbols, and apps.
- This page runs a live web trading terminal on a public exchange feed: real prices, candles, order book depth, and trades, loaded once over REST and then streamed over a single WebSocket, the same way a terminal reads an MT5 API gateway.
- An MT5 API gateway is what brokers mean by an MT5 REST API or an MT5 WebSocket API: MetaTrader 5 itself gives brokers a native Manager API and an HTTP Web API, and the gateway turns them into one API that web terminals and mobile apps can call safely.
What we build
MT5 gateway development:
what's included.
Liquidity provider connectors
Gateway API connectors to liquidity providers and prime brokers over FIX 4.4, REST, or WebSocket, with session management, sequence recovery, and reconnects.
Price feed gateway
Quotes into MT5 from one or several sources, with spike and stale-quote filters, markups per symbol and group, and synthetic instruments.
Symbol & execution mapping
Symbol, contract-size, and volume mapping per provider; partial fills, rejections, and execution reports written back as MT5 deals.
REST & WebSocket API over MT5
Accounts, balances, orders, positions, history, and streaming quotes for your terminals and apps, built on the Manager and Web APIs.
Auth, permissions & rate limits
Per-client tokens, scopes per application, IP allow-lists, request limits, and an audit log of every call that moves money or positions.
Monitoring & failover
Latency, fill-ratio, and rejection metrics per hop, health checks and alerts, and failover between providers and gateway instances.
Inside a running gateway
Quotes in, orders out,
every hop measured.
What the gateway does between your liquidity and your clients, and what your team sees while it runs: sessions, filters, mappings, and latency at every hop.
- LP AlphaFIX 4.4
- LP BetaFIX 4.4
- Prime brokerFIX 4.4
- Price feedWebSocket
- Aggregation
- Markups
- Spike filter
- Plugins
- Risk rules
- Execution
- Auth & 2FA
- Rate limits
- Audit log
- Web terminalWebSocket
- Mobile appsREST · WS
- Forex CRMREST
- AI assistantsMCP
Quotes → apps Orders → liquidityEnd to end, p50: 3.6 ms
| Time | Symbol | Source | Bid | Ask | Gateway |
|---|---|---|---|---|---|
| 15:02.184 | EURUSD | LP Alpha | 1.08386 | 1.08392 | Best bid |
| 15:02.187 | EURUSD | LP Beta | 1.08385 | 1.08391 | Best ask |
| 15:02.190 | XAUUSD | Prime | 3,693.31 | 3,693.49 | +0.15 markup |
| 15:02.193 | XAUUSD | Feed | 3,712.80 | 3,713.05 | Spike · dropped |
| 15:02.196 | GBPUSD | LP Alpha | 1.27158 | 1.27166 | Aggregated |
| 15:02.201 | US30 | Prime | 45,231.6 | 45,233.2 | +1.0 markup |
| 15:02.204 | BTCUSD | Feed | 112,476.0 | 112,489.0 | Stale 2 s · held |
| MT5 | Provider symbol | Route | Markup | |
|---|---|---|---|---|
| EURUSD5 digits | ⇄ | EUR/USD | LP Alpha | +0.2 pt |
| XAUUSD2 digits | ⇄ | XAU/USD | Prime | +0.15 |
| GBPUSD5 digits | ⇄ | GBP/USD | LP Beta | +0.3 pt |
| US301 digits | ⇄ | DJI30.cash | Prime | +1.0 |
| BTCUSD1 digits | ⇄ | BTC-USD | Feed | +5.0 |
POST /v1/orders
Idempotency-Key: 7f3c…a91e
{ "symbol": "EURUSD", "side": "buy", "volume": 1.0 }
201 Accepted · 4.1 ms
{ "order": 48213907, "state": "accepted" }- ws fill EURUSD buy 1.00 @ 1.08392
- ws position #48213907 +0.00
- ws quote EURUSD 1.08389 / 1.08395
Panels show demo data. Provider names, symbols, and the API are illustrative; each gateway is built around the broker's own providers, symbols, and apps.
At a glance
Liquidity gateway vs API gateway for MetaTrader 5
| Liquidity gateway | API gateway | |
|---|---|---|
| Connects MT5 to | Liquidity providers, prime brokers, and price feeds | Your own terminals, apps, CRM, and back-office services |
| MetaQuotes API | Gateway API | Manager API and Web API |
| Traffic | Prices in, orders out, fills back into MT5 | Requests from your apps in; account, trade, and price data out |
| Used by | The trade server and the dealing desk | Clients through your apps, and your staff systems |
| Main failure to design for | Lost or duplicated orders when a session drops | Overloading the MT5 server or exposing it to the internet |
| Often paired with | A liquidity bridge, when there are several providers | A web terminal, mobile apps, a CRM, and an MCP server |
How we build it
Engineered for
real money, from day one.
- 01Staging server first
Every connector and API runs against a staging MT5 server with realistic load and simulated providers before it touches production.
- 02No order left behind
Every order state change is explicit and logged at each hop, so an order is never lost or filled twice when a connection drops.
- 03Measured, not assumed
Each hop is timestamped, so latency, rejections, and slippage are visible per provider and per application from day one.
- 04Through every MT5 build
Each new MT5 server build is tested on staging before your production upgrade, so gateways keep working through MetaQuotes releases.
Platforms & technology
- MT5 Gateway API
- MT5 Manager API
- MT5 Web API
- FIX 4.4
- C++
- Go
- WebSocket
- PostgreSQL
- Redis
Questions
MT5 gateway development FAQ
What is an MT5 gateway?
An MT5 gateway is software that connects a MetaTrader 5 server to another system. In MetaQuotes' terms, a gateway is built on the MT5 Gateway API and links MT5 to an external liquidity provider or price feed. Brokers also use the word for an API gateway: a service on the Manager and Web APIs that lets their own web terminals, mobile apps, and CRM work with MT5 without connecting to the server directly.
Does MetaTrader 5 have a REST API or a WebSocket API?
Not one a browser or a phone app can call. MetaQuotes lists five APIs for brokers: the Gateway, Manager, Server, Web, and Report APIs. The Web API is the HTTP one — MetaQuotes describes it as “used for platform integration with web resources and other services of the company” — and, like the Manager API, it works as a manager account, so it belongs on a backend. A REST and WebSocket API with a sign-in per trader, permissions per application, rate limits, and live price streaming is what an MT5 API gateway adds on top of them. Nima Dorostkar's team builds that gateway and runs one in production with 76 REST routes and six realtime streams.
What is the difference between an MT5 gateway and an MT5 bridge?
The words overlap. In MetaQuotes' terms a gateway is a module built on the MT5 Gateway API that connects the server to one outside system: a liquidity provider, another trading system, or a price feed. “Bridge” comes from MetaTrader 4, which has no Gateway API, so the same connection was made by a bridge plugin; today it usually means the layer that aggregates several providers, applies markups, and routes orders A-book or B-book. In short, the gateway is the connection into MT5 and the bridge is the aggregation and routing behind it. A broker with one provider may need only a gateway; with several it usually runs both.
Can we build our own front end on MetaTrader 5?
Yes. MetaTrader 5 can stay the trade server and back office while your clients trade in your own web terminal or mobile app. An API gateway in front of the MT5 server gives your front end one REST and WebSocket API for sign-in, quotes, charts, orders, positions, and history, so your developers never work with MT5's own APIs or manager credentials. We can build the front end too, or hand your team the documented API.
Can you build a custom MT5 gateway for a liquidity provider?
Yes. We build MT5 Gateway API connectors that link MetaTrader 5 to a liquidity provider, a custom price feed, or your own execution system, with symbol mapping, price filtering, order routing, and execution reports back into MT5. Each connector is tested on a staging MT5 server before production and fails safe: if a connection drops it falls back to a safe default and alerts your team instead of blocking trading silently.
Can you build a secure gateway between MT5 and our own web or mobile apps?
Yes. We put a REST and WebSocket gateway over your MetaTrader 5 server, built on the Manager and Web APIs, so your web terminal, mobile apps, and client portal never connect to MT5 directly. The gateway handles authentication, permissions, and rate limits, and your MT5 server, groups, and accounts stay as they are.
Can one MT5 gateway connect to several liquidity providers?
Yes. With more than one provider, price aggregation, markups, and A-book, B-book, or hybrid routing usually live in a liquidity bridge that holds a FIX session per provider, and the MT5 gateway carries quotes, orders, and fills between that bridge and MetaTrader 5.
Can a white-label MT5 broker use a custom gateway?
Usually yes for an API gateway: a white-label broker can normally get a manager account and build on the Manager or Web API. A Gateway API connector to a liquidity provider runs on the MT5 server's side, so it needs the white-label provider's approval and installation.
How does a web trading terminal get live prices from MT5?
Through a gateway, not straight from the trade server. The gateway holds one connection to MT5 (the Manager API's price stream or the Web API), keeps the latest quote for each symbol, and fans it out to every client over WebSocket, applying each client's group spreads and symbol permissions on the way. The terminal loads chart history once over REST, then only listens to the stream and redraws a few times a second. The terminal on this page works the same way, pointed at a public exchange feed so you can watch it live.
Can I see a live demo of the trading terminal?
Yes, on this page. The terminal streams real prices, candles, order book depth, and trades from Gate.io's public market data (Binance's public feed is the fallback) straight to your browser. The account and positions are a demo: Buy and Sell open a position at the live price and nothing is sent to an exchange. For a walkthrough on a staging MT5 server with your own symbols and groups, get in touch.
How long does it take to build an MT5 gateway?
Deploying the team's existing gateway with standard connectors is faster than building one from scratch. A fully custom gateway, or a connector for a provider with an unusual API, typically takes 2–4 months like any focused component, including staging tests and a monitored launch.
How much does an MT5 gateway cost?
It depends on which kind you need and how much of it is custom. Deploying the team's ready-built API gateway and adapting it to your MT5 server, CRM sign-in, and apps costs less than a gateway built from scratch. The main drivers are the number of liquidity-provider connectors and how standard each provider's API is, how much of the API your apps need, the number of concurrent clients and the failover you require, and whether the team operates it after launch. After a short discovery you get a written estimate by phase.
What should I look for when hiring an MT5 gateway developer?
Broker-side experience, which is a different skill from writing Expert Advisors in MQL5. A gateway developer works with the MT5 Gateway, Manager, and Web APIs and with FIX 4.4, usually in C++ or Go. Ask for a gateway running in production, a staging MT5 server that every change is tested on, a clear answer to what happens to an order when a connection drops, monitoring at every hop, and ownership of the source code. Nima Dorostkar's team builds MT5 gateways on those terms and runs one in production for OPOTRADE, Opofinance's trading platform.
Start a project
Talk to an engineer about
MT5 gateway development.
Tell us what you run today and what you need. You'll hear back from a senior engineer with questions, a proposed architecture, and a realistic timeline.