Trade MetaTrader 5 over plain HTTP — headless, any broker.¶
mt5-gateway runs the real MT5 terminal under Wine in Docker and exposes it as a REST API. Point it at any MetaQuotes broker with three env vars and it logs itself in on boot — no Windows, no VNC, no manual clicking.
How it works, in three steps¶
Give it a server name¶
Not an IP, not a broker directory file — just the broker's server name
(e.g. Exness-MT5Trial9), your login, and your password.
It resolves and logs in¶
The gateway turns that name into a connectable address, launches the real MT5 terminal under Wine, and authorizes — headless, no VNC.
Trade over REST¶
Orders, positions, ticks, and history — all plain HTTP, with idempotency keys, a kill switch, and broker-truth reconciliation.
What you get¶
-
Headless login, any broker
No
servers.dat, no manual click-through. Give it a server name and it resolves and connects on its own. See why this exists. -
REST API + Swagger
Every endpoint documented and callable from
/apidocsthe moment the container is up. See the API reference. -
Idempotent orders
A stable
Idempotency-Keymakes retries safe — replay the same response instead of a duplicate order. Full detail in the API reference. -
Kill switch + audit log
POST /killhalts trading instantly; every order is append-only logged. See health, kill switch, and metrics. -
Broker-truth reconciliation
GET /reconcilereturns real positions, orders, and deals — recover strategy state after a restart or an ambiguous response. -
Drop-in broker for qkt
qkt — an event-driven trading engine — talks to this gateway out of the box. See Using with qkt.
Get started¶
- Quickstart — pull the image, run it, confirm it's alive.
- Install MT5 + mt5-gateway on a terminal — the boot sequence, step by step.
- Production deploy — a hardened Compose example.
- Configuration — every env var, core vs optional.
Built on the foundation laid by slowfound in metatrader5-quant-server-python.