MetaTrader 5 to FIX,
Without a DLL

MT5 FIX Bridge is an open-source bridge between a MetaTrader 5 account and a FIX 4.4 venue. An MQL5 Expert Advisor talks to a local Python engine over TCP, and the engine speaks FIX.

FIX 4.4
Initiator Session
0 DLL
Native MQL5 Sockets, Python Stdlib
2 Modes
Mirror and Routing
MIT
Free & Open Source

Two Commands, One Bridge

Start the engine, attach the EA. Orders stay in dry-run until you switch it off.

terminal - fixbridge
# 1. Optional: start the mock FIX venue for testing
python -m fixbridge.mock_venue --port 9878

# 2. Start the engine (dry-run is on by default)
python -m fixbridge -c config.ini -v

# 3. Attach the EA in MetaTrader 5: it connects to the engine on 127.0.0.1:9100

Built for the Plumbing Nobody Wants to Write

Orders, market data, positions and the FIX session, with safety defaults switched on.

Orders

New, cancel and replace orders (D, F, G) with market, limit and stop types, validated before they ever reach the venue.

Market Data

Subscribe from MT5 and receive top-of-book quotes built from FIX snapshots and incremental updates. Subscriptions are restored after a reconnect.

Positions

Request positions from the venue and read them back inside your EA.

FIX Session

Logon, heartbeats, test requests, sequence gap detection and automatic reconnection, with optional TLS.

Safety Defaults

Dry-run on by default, a symbol allow-list, a maximum quantity, a kill-switch file and optional token authentication.

Mirror & Routing

Mirror copies the deals made in MT5 to the venue. Routing swaps CTrade for CFixTrade, so the order is executed only by the venue.

How MT5 FIX Bridge Works

From a MetaTrader 5 order to a FIX message: five stages

EA
MQL5 Expert Advisor, or CFixTrade inside your own EA
→
Local Socket
Line protocol over TCP on 127.0.0.1
→
Engine
Python asyncio: validation, risk checks, symbol mapping
→
FIX Session
FIX 4.4 logon, heartbeats, resend, reconnect
→
Venue
Your FIX counterparty

Why a Bridge

MetaTrader 5 speaks to its broker. This lets it speak FIX.

The Problem

MetaTrader 5 has no native FIX client. Its FIX API is a product offered on the broker side.

The Approach

A local socket carries orders to an engine written in standard-library Python, so there is no DLL to install or trust.

Safe by Default

Orders are filled locally in dry-run until you switch it off, and the limits and the kill switch apply from the first run.

Open Source

MIT licensed. Read it, audit it, fork it and run it on your own machine.

Clone It, Test It, Own It

MT5 FIX Bridge is free and open source under the MIT license. Clone it and run the test suite against the mock venue.