What Is FIX Protocol? A Plain-English Guide for Trading Firms
What the FIX protocol is, how a FIX session and order messages work, which version to use, and what to check before connecting to a broker or liquidity provider.
By ThinkStak Engineering 8 min read
The FIX protocol (Financial Information eXchange) is the standard message format that brokers, liquidity providers, exchanges and trading firms use to send orders, executions and market data to each other. Two systems open a long-lived FIX session, exchange numbered messages such as "new order" and "execution report", and use those sequence numbers to make sure nothing is lost or processed twice.
If your broker or liquidity provider says "we offer FIX connectivity", this guide explains what that means, how it works on the wire, and what usually goes wrong when a trading firm connects for the first time.
Why trading firms use FIX instead of a REST API
Most retail-facing brokers offer a REST or WebSocket API. FIX is different in a few ways that matter for serious order flow:
- It is a session, not a series of requests. Both sides stay connected all day and exchange messages in both directions. Fills and cancels arrive the moment they happen, without polling.
- Every message is numbered. Each side counts the messages it sends. If a number is skipped, the other side notices and asks for the missing messages to be resent.
- It is a shared standard. Order types, sides, statuses and rejection reasons use the same fields across counterparties, so an engine built for one FIX gateway can be adapted to another far faster than rewriting a proprietary API integration.
- Counterparties already speak it. Liquidity providers, prime brokers and many institutional broker gateways offer FIX as their main or only interface.
The trade-off is that FIX is less forgiving than a REST API. You are responsible for keeping the session healthy, handling sequence gaps and reconciling every order — which is where most of the engineering effort goes.
What a FIX message looks like
The classic FIX encoding, called tag=value, is plain text. Each field is a number (the tag), an equals sign and a value, and fields are separated by an invisible control character (SOH, often shown as | in logs). A simplified new order looks like this:
8=FIX.4.4|9=...|35=D|49=CLIENT1|56=BROKER|34=215|52=20261201-09:30:00.123|
11=ORD-000123|55=EURUSD|54=1|38=100000|40=2|44=1.0850|59=0|10=...|The tags you will see constantly:
- 8 BeginString — the FIX version of the session, for example
FIX.4.4 - 35 MsgType — what kind of message this is (
Dis a new order,8is an execution report) - 49 / 56 SenderCompID / TargetCompID — who is sending and who is receiving; agreed with the counterparty in advance
- 34 MsgSeqNum — the message's sequence number in this session
- 11 ClOrdID — your own unique ID for the order
- 55, 54, 38, 40, 44 — symbol, side, quantity, order type and price
- 9 BodyLength and 10 CheckSum — integrity fields the engine calculates for you
Tag=value is the original and still the most widely used FIX encoding. The FIX Trading Community also publishes other encodings, such as FIXML and Simple Binary Encoding (SBE), used where XML or very low latency is required.
How a FIX session works
A FIX connection has two layers: the session layer, which keeps the connection alive and ordered, and the application layer, which carries the actual trading messages. The session layer uses a small set of messages:
- Logon (35=A) — opens the session. It carries the agreed heartbeat interval (tag 108, HeartBtInt) and can ask to reset sequence numbers.
- Heartbeat (35=0) — sent when nothing else has been sent for one heartbeat interval, so both sides know the link is alive.
- TestRequest (35=1) — "are you still there?" The other side must answer with a Heartbeat, or the connection is treated as dead.
- ResendRequest (35=2) — "I am missing messages X to Y, please resend them."
- SequenceReset (35=4) — used to skip over messages that should not be resent (gap fill) or to move the sequence number forward.
- Reject (35=3) — a message was malformed at the session level.
- Logout (35=5) — closes the session cleanly.
A typical day looks like this: your engine connects over TCP (often through a VPN, cross-connect or TLS), sends Logon, receives a Logon back, and the session is up. Heartbeats flow in quiet periods. If your engine restarts mid-day, it logs on again with the next expected sequence number, and if either side spots a gap, it sends a ResendRequest and the missing messages are replayed or gap-filled. Many counterparties reset sequence numbers on a fixed schedule, such as daily or weekly — that schedule is part of what you agree with them.
Orders and execution reports: the application layer
Once the session is up, the trading itself happens through a handful of application messages:
- NewOrderSingle (35=D) — place an order
- OrderCancelRequest (35=F) — cancel an order
- OrderCancelReplaceRequest (35=G) — modify price or quantity
- ExecutionReport (35=8) — the counterparty's answer to everything: order accepted, partially filled, filled, cancelled, replaced or rejected
- OrderCancelReject (35=9) — a cancel or modify could not be done
- MarketDataRequest (35=V) with snapshot (35=W) and incremental refresh (35=X) responses — for price feeds, when the counterparty offers market data over FIX
The ExecutionReport is the heart of it. Two fields tell you what happened: ExecType (150) says what this particular report is about (new, trade, cancelled, rejected and so on), and OrdStatus (39) says the overall state of the order now. A single order can produce many reports — accepted, three partial fills, then filled — and your system has to apply each one in order to know the true position.
That is why a FIX integration always needs an order state machine: a record of every order your system sent, keyed by ClOrdID, updated only from execution reports. Your positions and P&L should be built from fills the counterparty confirmed, not from orders you think you sent.
FIX 4.2, 4.4, 5.0 and "FIX Latest": which version?
The FIX Trading Community currently lists FIX 4.2 and FIX 4.4 as supported versions, with their specifications frozen, and FIX Latest as the evolving version that is updated through extension packs. FIX 5.0 SP2 has been moved to the unsupported list, although implementations that use it keep working.
Two practical points:
- Your counterparty decides. In practice you implement whatever version the broker or liquidity provider runs. In retail FX, CFD and many broker gateways, that is very often FIX 4.4.
- FIX 5.0 and later separate the session layer. From FIX 5.0 onwards the session layer is a separate specification called FIXT 1.1, so the session's BeginString reads
FIXT.1.1and the application version is carried separately. Your FIX engine has to support whichever combination the counterparty uses.
Whatever the version, every counterparty also has its own rules of engagement document: which order types it accepts, which custom tags it requires, how it formats symbols and accounts, and when sessions reset. Treat that document as the real specification.
What goes wrong in real FIX integrations
The FIX standard itself is stable. The problems come from how integrations handle real-world conditions:
- Sequence numbers lost on restart. If your engine does not persist its message store, a restart can send the wrong sequence number, causing the counterparty to reject the logon or replay a day's worth of messages.
- Resent orders treated as new. Messages replayed after a gap are marked as possible duplicates (PossDupFlag, tag 43). An engine that ignores this can double-count fills or resubmit orders.
- Non-unique ClOrdIDs. Reusing an order ID across restarts or days confuses both sides and makes reconciliation unreliable.
- Partial fills handled as full fills, or a cancel sent after an order was already filled, leaving internal positions out of sync with the broker.
- Custom tags ignored. Counterparty-specific fields — account, routing or user-defined tags — missing from orders, so they get rejected only in production.
- No raw message log. When a counterparty disputes a trade, the raw FIX log is the evidence. Without it, you are arguing from memory.
- Stale market data. A price subscription that silently stops updating, while the session stays up, leads strategies to trade on old prices. Monitor the age of the last update, not only the connection.
Checklist before you connect to a FIX counterparty
- Get the counterparty's rules of engagement and confirm the FIX version, session times and sequence reset schedule
- Agree SenderCompID / TargetCompID, network route (VPN, cross-connect, TLS) and IP allow-listing
- Use a proven FIX engine (QuickFIX/J, QuickFIX/n, QuickFIX for C++/Python, or a commercial engine) rather than writing the session layer yourself
- Persist the message store and sequence numbers to disk so restarts are safe
- Generate unique ClOrdIDs that never repeat across restarts or days
- Build an order state machine driven only by ExecutionReports, including partial fills, rejects and cancel rejects
- Handle PossDupFlag and resent messages explicitly
- Keep a full raw message log and make it searchable by order ID
- Add monitoring and alerts for disconnects, sequence gaps, rejects and stale market data
- Plan for conformance testing in the counterparty's UAT environment before going live
How ThinkStak builds FIX integrations
ThinkStak builds FIX protocol integrations for brokers, prop firms and fintech teams: session engines, order routing, market data, counterparty dialect mapping and complete message logs. FIX often sits next to other connectivity work, such as broker API integration or an in-house OMS and risk engine that every order passes through first.
If you are planning a FIX connection or replacing an unreliable bridge, book a free audit and we can review your counterparty's requirements with you.
Note: ThinkStak builds trading software only. Nothing in this guide is investment advice, and we do not provide trading signals or profit claims.
