Realtime
FIX 4.4
Institutional connectivity with the same key, the same guards and the same error codes as the Trading API. Two session types - QUOTE for market data and TRADE for orders - over TLS on port 5201.
#Session
| Endpoint | api.your-brand.com:5201 - the API host, TLS 1.2+ (your broker's panel shows the exact host and port) |
|---|---|
| Version | FIX 4.4, standard header and trailer, SOH-delimited (shown here with |) |
| SenderCompID (49) | K<key id> - the numeric id of your Trading API key, e.g. K12 |
| TargetCompID (56) | The CompID shown in your broker's API access panel (default OCTOLIT) |
| TargetSubID (57) | QUOTE or TRADE - one session type per connection; open both for a full setup |
| Password (554) | Your API key (qk_…) with the fix scope |
| Sequence numbers | Send 141=Y to reset both sides on logon (recommended); sessions are not resumed across reconnects |
| Heartbeat | 108 between 5 and 120 s; Test Request / Heartbeat as per FIX 4.4 |
#Logon (35=A)
| Tag | Value |
|---|---|
8 | FIX.4.4 |
35 | A |
49 | K<key id> - the key id shown in the API access panel |
56 | The TargetCompID shown in the panel (OCTOLIT in these examples) |
57 | QUOTE or TRADE - the session you want |
98 | 0 |
108 | Heartbeat interval, 5 - 120 s |
141 | Y to reset sequence numbers on both sides |
554 | Your API key (qk_…) |
Logon
8=FIX.4.4 | 35=A | 49=K12 | 56=OCTOLIT | 57=TRADE | 34=1 | 98=0 | 108=30 | 141=Y | 554=qk_... |A refused logon answers 35=5 Logout with the reason in 58 (one of the Trading API error codes, e.g. invalid_api_key, open_api_disabled, ip_not_allowed).
#QUOTE session - market data
| You send | You receive |
|---|---|
35=V MarketDataRequest: 262 request id, 263 0 snapshot / 1 snapshot + updates / 2 unsubscribe, 264=0, 265, 267 with 269 0 bid / 1 offer, 146 + 55 per symbol (X:EURUSD, the numeric id, or EUR-USD). Up to 100 symbols. | 35=W snapshot per symbol, then 35=X incremental refreshes (at most one per symbol every 250 ms). Unknown symbol: 35=Y with 281=0. |
Quotes are the trading prices (bid / ask with the account type's spread) - the same values the Trading API and the WebSocket deliver.
#TRADE session - orders
| Message | Tags | Answer |
|---|---|---|
D NewOrderSingle | 11 ClOrdID, 1 trading account id (optional with one account), 55 symbol or id (or 48 + 22=8), 54 1 buy / 2 sell, 38 quantity in units (lots x contract size), 40 1 market / 2 limit (44) / 3 stop (99), 59 1 (GTC), 9101 stop loss, 9102 take profit, 9103 leverage | 35=8 150=0 New, then 150=F 39=2 for a market order (31/32); 150=8 Rejected with 103 + 58 |
D + 721 (close) | 721 position id, 54 the opposite side, 38 the whole position or less (partial close where allowed) | 150=0 + 150=F, OrderID C<closed row id>, 721 = the position |
F OrderCancelRequest | 11 new ClOrdID, 41 the order's ClOrdID (or 37) | 150=4 39=4; a filled order: 35=9 102=0; unknown: 35=9 102=1 |
G OrderCancelReplaceRequest | 11, 41 (or 37), 44 / 99 new price (pending), 9101 / 9102 (0 removes); quantity and type cannot change | 150=5 Replaced; refused: 35=9 434=2 |
H OrderStatusRequest | 11 or 37 | 150=I; unknown: 150=I 39=8 103=5 |
AF OrderMassStatusRequest | 584, optional 1 / 55 | 150=I per pending order and open position, 911 total, 912=Y on the last |
AN RequestForPositions | 710, 724=0, optional 1 / 55 | 35=AO then one 35=AP per open position (721, 704/705, 730 open price, 9101/9102) |
NewOrderSingle - buy 10 000 EURUSD at 1.0750 limit with a stop loss
8=FIX.4.4 | 35=D | 49=K12 | 56=OCTOLIT | 57=TRADE | 34=2 | 11=my-order-1 | 1=55 | 55=X:EURUSD | 54=1 | 38=10000 | 40=2 | 44=1.0750 | 59=1 | 9101=1.0700 | 60=20261010-12:00:00.000 |ExecutionReport - 150=0 New
8=FIX.4.4 | 35=8 | 49=OCTOLIT | 50=TRADE | 56=K12 | 37=812 | 11=my-order-1 | 17=... | 150=0 | 39=0 | 1=55 | 55=X:EURUSD | 54=1 | 40=2 | 44=1.0750 | 38=10000 | 14=0 | 151=10000 | 6=0 | 721=812 | 9101=1.07 |11 ClOrdIDis theclient_order_idof the REST API: the same value is idempotent across FIX and REST.- Quantity
38is in units (lots × contract size).44limit price,99stop price. Time in force is59=1(GTC); a market order fills or rejects at once. - Market fills answer
150=0then150=F 39=2with31price and32quantity; the position id comes in721. - Every reject (
150=8,35=9,35=3) carries the REST error code in58, so one error table serves both protocols.
#Reject reasons (103)
0
OrdRejReasonRefused by the broker1
OrdRejReasonUnknown symbol2
OrdRejReasonMarket closed3
OrdRejReasonOrder exceeds limit5
OrdRejReasonUnknown order6
OrdRejReasonDuplicate ClOrdID11
OrdRejReasonUnsupported order characteristic13
OrdRejReasonIncorrect quantity99
OrdRejReasonOther - see tag 58 (REST error code)#Limits
| Transport | TCP + TLS 1.2 or newer |
| Version | FIX 4.4 |
| HeartBtInt (108) | 5 - 120 s |
| Messages per second per session | 50 (burst 100) |
| Logons per minute per address | 30 |
| Connections per address | 20 |
| Symbols per QUOTE session | 100 |
| Quote updates | at most one X per symbol every 250 ms |
#Custom tags
| Tag | Meaning |
|---|---|
9101 | Stop loss price (absolute). 0 in a replace removes it. |
9102 | Take profit price (absolute). 0 in a replace removes it. |
9103 | Leverage for the order, when the symbol offers a choice. |
721 | Position id - set on fills, used in a close (D with 721) and in position reports (AP). |
Need a certification session or a sample log? Ask your broker; the FIX message lab builds and parses messages in the browser.