The FIX (Financial Information Exchange) protocol is the de facto standard for electronic communication between financial institutions, brokers, traders, and exchanges. Nearly every trade executed in global financial markets involves FIX protocol communication at some point.
๐ What is FIX Protocol?
FIX is a standardized messaging protocol designed to facilitate the exchange of information about securities transactions and market data between buyers and sellers in real-time.
Key Characteristics:
- Open Standard - Maintained by the FIX Trading Community
- Language-Agnostic - Works across all programming languages and platforms
- Efficient - Text-based format with minimal overhead
- Extensible - Supports custom fields and message types
- Pervasive - Used in 90%+ of institutional trading infrastructure
๐๏ธ FIX Protocol Structure
A FIX message consists of:
- Begin String - Protocol version (e.g., FIX.4.4)
- Body Length - Length of the message body
- Message Type - Single character identifying the message (e.g., D = New Order, 0 = Heartbeat)
- Fields - Key-value pairs separated by SOH (Start of Header) character
- Checksum - Three-byte checksum for message validation
Example FIX Message
8=FIX.4.4|9=123|35=D|49=SENDER|56=TARGET|34=1|52=20260410-12:30:45|
11=ORDER123|55=AAPL|54=1|38=100|40=2|44=150.25|...
Where:
8 = Begin String
9 = Body Length
35 = Message Type (D = New Order)
49 = Sender ID
56 = Target ID
34 = Message Sequence Number
52 = Send Time
๐ Common FIX Message Types
| Msg Type | Code | Purpose |
|---|
| Heartbeat | 0 | Keep connection alive |
| Test Request | 1 | Test connection |
| Logon | A | Establish session |
| Logout | 5 | End session |
| New Order | D | Submit trading order |
| Order Cancel Request | F | Cancel existing order |
| Order Status Request | H | Query order status |
| Execution Report | 8 | Confirm trade execution |
| Market Data | W | Quote/price updates |
| Trade Capture | AE | Report executed trades |
๐จ Common FIX Fields
Session & Routing Fields
| Tag | Field Name | Description |
|---|
| 8 | BeginString | Protocol version (e.g., FIX.4.4) |
| 9 | BodyLength | Length of message body in bytes |
| 34 | MsgSeqNum | Sequence number (incremental) |
| 35 | MsgType | Type of message (A=Logon, D=New Order, etc.) |
| 49 | SenderCompID | Sender identifier |
| 56 | TargetCompID | Recipient identifier |
| 142 | SenderSubID | Sender sub-identifier (optional) |
| 143 | TargetSubID | Target sub-identifier (optional) |
| 108 | HeartBtInt | Heartbeat interval (seconds) |
| 98 | EncryptMethod | 0=None, 1=PKCS, 2=DES (encryption type) |
Time & Date Fields
| Tag | Field Name | Description | Example |
|---|
| 52 | SendingTime | Message send time (UTC) | 20260410-12:30:45.123 |
| 60 | TransactTime | Transaction execution time | 20260410-12:30:45 |
| 273 | ValidUntilTime | Order valid until time | 20260410-17:00:00 |
| 108 | ExpireTime | Session expiration time | 20260410-16:30:00 |
| 225 | MaturityDate | Security maturity date | 20360415 |
| 200 | MaturityMonthYear | Maturity month/year | 202604 |
Account & Party Fields
| Tag | Field Name | Description | Example |
|---|
| 1 | Account | Account identifier | ACC_12345 |
| 109 | ClientID | Client identifier | CLIENT_001 |
| 110 | ClOrdLinkID | Link to related order | ORDER_PARENT_1 |
| 453 | NoPartyIDs | Number of parties | 2 |
| 454 | PartyIDSource | Identifier source (1=CUSIP, D=DUNS, B=Bloomberg) | D |
| 455 | PartyRole | Role of party (1=Exec, 2=Broker, 3=Client) | 2 |
Order Details Fields
| Tag | Field Name | Description |
|---|
| 11 | ClOrdID | Client-assigned order ID |
| 37 | OrderID | Broker-assigned order ID |
| 55 | Symbol | Security symbol (e.g., AAPL, EURUSD) |
| 107 | SecurityDesc | Text description of security |
| 54 | Side | 1=Buy, 2=Sell, 3=Buy minus, 4=Sell plus |
| 38 | OrderQty | Order quantity (shares, contracts, lots) |
| 40 | OrdType | 1=Market, 2=Limit, 3=Stop, 4=Stop Limit, 5=Trailing Stop |
| 44 | Price | Limit order price |
| 99 | StopPx | Stop price for stop orders |
| 59 | TimeInForce | 0=Day, 1=GTC, 3=IOC, 4=FOK, 5=GTX, 6=GTD |
| 18 | ExecInst | Execution instructions (M=Manual, P=Do not initiate) |
| 21 | HandlInst | Handling instruction (1=Automated, 2=Manual) |
Order Status & Rejection Fields
| Tag | Field Name | Description |
|---|
| 39 | OrdStatus | 0=New, 1=Partial, 2=Filled, 4=Cancelled, 5=Replaced, 8=Rejected, A=Pending |
| 103 | OrdRejReason | Reason for order rejection (1=Bad price, 2=Bad quantity, 10=Unsupported order type) |
| 58 | Text | Free-format text explaining order status |
| 150 | ExecType | 0=New, 1=Partial, 2=Fill, 3=DoneForDay, 4=Cancelled, 5=Replaced, 6=PendingCancel |
Fill & Execution Details
| Tag | Field Name | Description |
|---|
| 32 | LastQty | Quantity filled in this execution |
| 31 | LastPx | Price of last fill |
| 151 | LeavesQty | Remaining quantity to be filled |
| 14 | CumQty | Total cumulative quantity filled |
| 6 | AvgPx | Average price of fills |
| 17 | ExecID | Execution identifier |
| 20 | ExecTransType | 0=New, 1=Cancel, 2=Correct, 3=Status |
Fees & Commission Fields
| Tag | Field Name | Description | Example |
|---|
| 12 | Commission | Commission amount | 50.00 |
| 13 | CommType | 1=Percent, 2=Absolute, 3=Per unit | 2 |
| 479 | OrderCapacity | Capacity (A=Agency, P=Principal, R=Riskless) | A |
| 378 | ExecRestatementReason | Reason for restatement | 0 |
Risk & Limit Fields
| Tag | Field Name | Description | Example |
|---|
| 277 | TradeStatus | Trade status (0=Accepted, 7=Rejected) | 0 |
| 378 | ExecRestatementReason | Reason for restatement/rejection | Account limit exceeded |
| 208 | ApplVerID | Application version ID | FIX.4.4 |
| Tag | Field Name | Usage | Example |
|---|
| 55 | Symbol | Stock/Futures symbol | AAPL, ESZ26 (E-mini S&P 500 Dec 2026) |
| 107 | SecurityDesc | Security description | Apple Inc., S&P 500 Dec Futures |
| 54 | Side | 1=Buy, 2=Sell | 1 (Buy) |
| 38 | OrderQty | Order quantity | 100 shares or contracts |
| 40 | OrdType | 1=Market, 2=Limit, 3=Stop | 2 (Limit Order) |
| 44 | Price | Limit order price | 150.25 |
| 99 | StopPx | Stop price for stop orders | 145.00 |
| 59 | TimeInForce | 0=Day, 1=GTC, 3=IOC, 4=FOK | 0 (End of Day) |
| 18 | ExecInst | Execution instructions | M=Manual execution, P=Participate do not initiate |
| Tag | Field Name | Usage | Example |
|---|
| 55 | Symbol | Option underlying symbol | AAPL |
| 200 | MaturityMonthYear | Option expiration | 202604 (April 2026) |
| 202 | StrikePrice | Strike price of option | 155.00 |
| 207 | SecurityType | Underlying security type | OPT (Option) |
| 461 | CFICode | ISO classification of security | OCAXPS = Call Option |
| 462 | OptPayAmount | Option payout amount | - |
| 201 | PutOrCall | 0=Put, 1=Call | 1 (Call Option) |
| 37 | OrderID | Broker-assigned order ID | OPT_ORDER_001 |
| 38 | OrderQty | Number of contracts | 10 (10 option contracts = 1000 shares) |
| 40 | OrdType | 1=Market, 2=Limit | 2 (Limit) |
| 44 | Price | Premium per contract | 3.50 |
| Tag | Field Name | Usage | Example |
|---|
| 453 | NoPartyIDs | Number of parties in message | 2 |
| 454 | PartyIDSource | Identifier source | D=DUNS, 1=CUSIP, B=Bloomberg |
| 385 | ListID | List identifier for multi-leg orders | STRAT_001 |
| 386 | ListExecType | Execution type of list | 0=Immediate, 1=Wait for Execution |
| 394 | EncodedListExecInst | Encoded execution instruction | - |
| 555 | NoLegs | Number of legs in multileg security | 2 (Spread: Long Call + Short Call) |
| 600 | LegSymbol | Symbol of leg security | AAPL (leg 1), SPY (leg 2) |
| 601 | LegSymbolSfx | Leg security suffix | CD (when issued) |
| 602 | LegSecurityID | Security ID of leg | - |
| 608 | LegPriceType | Price type of leg | 1=Percentage, 2=Per unit |
| 609 | LegQty | Quantity for this leg | 100 (buy), -100 (sell for spread) |
| 611 | LegSide | Side of leg | 1=Buy leg, 2=Sell leg |
| 624 | LegRefID | Reference ID of leg | - |
| Tag | Field Name | Usage | Example |
|---|
| 107 | SecurityDesc | Bond description | US Treasury 10Y |
| 207 | SecurityType | BOND, FUT (Bond Futures) | BOND |
| 56 | TargetCompID | Yield to maturity | 4.25 |
| 108 | CouponRate | Coupon rate of bond | 3.50 |
| 225 | MaturityDate | Maturity date | 20360415 (April 15, 2036) |
| 212 | XmlDataLen | XML data length for complex bonds | - |
| 213 | XmlData | XML formatted data | - |
| Tag | Field Name | Usage | Example |
|---|
| 55 | Symbol | Underlying security symbol | UST 10Y |
| 54 | Side | 1=Buy/Borrow, 2=Sell/Lend | 1 (Repo): Borrow cash, lend security |
| 38 | OrderQty | Amount in basis quantity | 1000000 (par value) |
| 44 | Price | Repo rate | 4.75 |
| 108 | Term | Term of repo in days | 30 |
| 196 | ContAmtType | Contract amount type | - |
| Tag | Field Name | Usage | Example |
|---|
| 55 | Symbol | Currency pair | EUR/USD or EURUSD |
| 54 | Side | 1=Buy base, 2=Sell base | 1 (Buy EUR, Sell USD) |
| 38 | OrderQty | Amount in base currency | 1000000 (1M EUR) |
| 40 | OrdType | 1=Market, 2=Limit, 3=Stop | 2 (Limit) |
| 44 | Price | Exchange rate | 1.0950 |
| 273 | ValidUntilTime | Time order is valid until | 20260410-17:00:00 |
Product-Type Indicators
| Tag | Field Name | Values | Usage |
|---|
| 207 | SecurityType | EQUITY, FUT, OPT, BOND, CORP, FOREX, MMNOTES | Identifies instrument type |
| 461 | CFICode | First character identifies category, rest for details | Standardized classification |
| 555 | NoLegs | Integer | Present only in multi-leg strategies |
๏ฟฝ๐ Typical FIX Communication Flow
Trader/Application FIX Session Broker/Exchange
| | |
|--- Logon (A) -------->| |
|<--- Logon Response ---| |
| |--- Logon (A) -------->|
| |<--- Logon Response ---|
| | |
|--- New Order (D) ---->| |
| |--- New Order (D) ----->|
| |<--- Execution Rpt (8) -|
|<--- Execution Rpt (8) | |
| | |
|--- Logout (5) ------->| |
|<--- Logout Response --| |
| |--- Logout (5) ------->|
| |<--- Logout Response --|
๐ป FIX Session Management
Session Establishment (Logon)
A client initiates a session with authentication credentials:
35=A (Message Type: Logon)
49=TRADER_APP (Sender)
56=BROKER (Target)
34=1 (Sequence Number)
108=30 (Heartbeat Interval - every 30 seconds)
98=0 (No encryption)
141=Y (Reset sequence numbers)
Heartbeat
To keep the connection alive, heartbeats are sent at regular intervals (typically 30 seconds):
35=0 (Heartbeat)
49=TRADER_APP
56=BROKER
34=2
Session Termination (Logout)
35=5 (Logout)
49=TRADER_APP
56=BROKER
34=100
58=End of trading day
๐ Order Workflow Example
Step 1: Submit Order
35=D (New Order)
11=ORDER_20260410_001 (Client Order ID)
55=AAPL (Symbol)
54=1 (Side: Buy)
38=100 (Quantity)
40=2 (Order Type: Limit)
44=150.25 (Price)
Step 2: Broker Acknowledges
35=8 (Execution Report)
37=BROKER_ORDER_123 (Order ID)
39=0 (Order Status: New)
150=0 (Exec Type: New)
151=100 (Leaves Qty)
Step 3: Partial Fill
35=8 (Execution Report)
37=BROKER_ORDER_123
39=1 (Order Status: Partially Filled)
150=F (Exec Type: Partial Fill)
32=50 (Last Qty Filled)
31=150.25 (Last Price)
151=50 (Leaves Qty)
Step 4: Full Fill
35=8 (Execution Report)
37=BROKER_ORDER_123
39=2 (Order Status: Filled)
150=2 (Exec Type: Filled)
32=50 (Last Qty Filled)
151=0 (Leaves Qty)
๐ Security Considerations
Authentication
- Username/password in Logon message
- TLS/SSL encryption for transport
- Message sequencing to prevent replay attacks
Message Integrity
- Checksum validation
- Sequence number tracking
- Duplicate detection
Compliance
- Audit trail of all messages
- Immutable order records
- Regulatory reporting (MiFID II, Dodd-Frank, etc.)
๐ FIX Protocol in Production
Common Use Cases
- Equity Trading - Buy/sell stocks, ETFs
- Options Trading - Complex derivatives
- Fixed Income - Bond trading
- Forex - Currency trading
- Market Data Distribution - Real-time quotes and analytics
Key Players Using FIX
- Investment Banks (JPMorgan, Goldman Sachs, Deutsche Bank)
- Brokerages (Interactive Brokers, Charles Schwab)
- Exchanges (NYSE, NASDAQ, London Stock Exchange)
- Market Data Providers (Bloomberg, Reuters)
- Trading Platforms (TD Ameritrade, Interactive Brokers API)
๐ FIX Protocol Versions
- FIX 4.0 - Original version (1992)
- FIX 4.2 - Standard for derivatives
- FIX 4.4 - Most widely used (2006)
- FIX 5.0 - Latest major version (2009)
- FIXT 1.1 - Transport layer protocol
The version used depends on exchange requirements and trading workflows.
๐ ๏ธ Implementing FIX
Popular Open-Source Libraries
quickfixj (Java)
SocketAcceptor acceptor = new SocketAcceptor(
application,
messageStoreFactory,
settings);
acceptor.start();
QuickFIX (C++)
FIX::SessionSettings settings("session_config.cfg");
FIX::SocketAcceptor acceptor(application, storeFactory, settings);
acceptor.start();
python-quickfix (Python)
import quickfix as fix
settings = fix.SessionSettings("config.cfg")
store = fix.FileStoreFactory(settings)
log = fix.FileLogFactory(settings)
initiator = fix.SocketInitiator(application, store, settings, log)
initiator.start()
โ๏ธ Protocol Customization
Custom Fields
Exchanges and brokers often define field ranges for custom data:
- User-Defined Fields: 5000-9999
- Exchange-specific fields extend base FIX functionality
Message Extensions
- Trade capture reports with additional data
- Risk parameters and position limits
- Custom matching rules
๐ฏ Advantages of FIX Protocol
โ
Standardization - Industry-wide adoption
โ
Efficiency - Minimal latency and overhead
โ
Reliability - Robust error handling and sequencing
โ
Flexibility - Extensible with custom fields
โ
Security - Built-in authentication and checksums
โ
Interoperability - Works across all systems and languages
๐ Resources