Products Connect

Your MT5 broker, over plain HTTP.

A REST API for MetaTrader 5, running headless under Wine in Docker. Point it at a broker that offers MetaTrader 5 and qkt trades through it.

Test on a demo account first
Latest release
v0.3.19
Licence
MIT
Image
Docker Hub, amd64
API
HTTP on :5001
  1. qkt
  2. mt5-gateway
  3. MT5 terminal
  4. Your broker
qkt.config.yaml
brokers:
  exness:
    type: mt5
    gateway_url: ${QKT_BROKER_EXNESS_GATEWAY_URL}

qkt reaches the broker through the gateway, at this address. The broker's name here is the prefix your strategy uses, like EXNESS:EURUSD. qkt waits for the gateway to report ready before it trades.

Source: mt5-gateway/docs/connect/qkt.md

In motion

An order, from qkt to your broker.

Follow one order through each hop. The gateway sits between qkt and the terminal, so qkt never touches MT5 directly.

An order travels from qkt through the MT5 gateway and the MT5 terminal to the broker, and the fill comes back the same way.

Set up

Four environment variables.

The gateway logs itself in on boot, by broker server name, with no desktop and no manual login. qkt waits for its health check before it trades.

run the gateway
docker run -d --name mt5-gateway --restart unless-stopped \  -p 127.0.0.1:5001:5001 -p 127.0.0.1:3000:3000 -v mt5-gateway-config:/config \  -e MT5_LOGIN=12345678 -e MT5_PASSWORD='...' -e MT5_SERVER=Exness-MT5Trial9 \  -e MT5_ENABLE_ALGO_TRADING=1 -e API_KEY='...' elitekaycy/mt5-gateway-api:latest

Built with safeguards

Designed to avoid duplicate orders, with a kill switch. Neither is a guarantee.

  • Idempotent ordersEvery order carries a key. A retry replays the answer instead of trading twice.
  • A kill switchOne call blocks new risk, even when your strategy engine is down.
  • Identity guardsqkt refuses to start if the account, server or demo-or-real mode is not the one you expected.

Know the limits

What to expect.

  • A large imageAbout 2.75 GB to pull, measured on an early release. amd64 only.
  • A slow first bootThe first MT5 start can take several minutes. Later boots are quick.
  • One account per containerRun one gateway for each account. They never share a Wine prefix.
  • Not identical everywhereWorks with brokers that offer MetaTrader 5, if their terms allow automated, headless use. Check yours. Fill behaviour still varies by broker.
Gateway documentation

The path

  1. 1Write and testqkt engine
  2. 2Connect a broker or venueMT5 gatewayVenue gateway
  3. 3Set limits on the accountGuardrails
  4. 4Watch it runqkt Insights

Next: set limits with Guardrails

Write your first strategy today.

One command to install. Eight lines to a backtest. Free and open source.