Market Data
Subscribe to real-time market data updates via FIX 4.4 protocol
The Market Data session provides real-time order book streaming via the FIX 4.4 protocol. Use this session to subscribe to price updates for specific trading instruments and receive continuous market data.
For FIX connection settings (host, port, SenderCompID, TargetCompID, credentials), contact your broker.
This page covers the Market Data session only. For trading operations (order placement, execution reports), use the Trading session.
Supported message types
The following values can be assigned to the <35> MsgType field:
A— Logon (Client → B2PRIME)0— Heartbeat (Client ↔ B2PRIME)1— Test Request (Client ↔ B2PRIME)3— Reject (Client ← B2PRIME)4— Sequence Reset (Client ↔ B2PRIME)5— Logout (Client ↔ B2PRIME)V— Market Data Request (Client → B2PRIME)W— Market Data — Snapshot/Full Refresh (Client ← B2PRIME)X— Market Data — Incremental Refresh (Client ← B2PRIME)Y— Market Data Request Reject (Client ← B2PRIME)j— Business Reject (Client ← B2PRIME)
Getting started
Connection
To connect to the Market Data session, use the following parameters provided by B2PRIME:
Host and port: The Market Data endpoint (provided separately from the Trading endpoint)
SenderCompID: Your client identifier for the Market Data session
TargetCompID: The server identifier for the Market Data session
Protocol: FIX 4.4
The Market Data connection does not require SSL.
Message structure
Standard Header
All FIX messages must begin with a Standard Header containing the following fields:
8 BeginString String
Identifies the FIX version (FIX.4.4). Always the first field in a message.
9 BodyLength int
The automatically computed message length, in bytes. Always the second field.
35 MsgType String
The message type. See Supported message types for possible values. Always the third field.
34 MsgSeqNum int
The message sequence number, incremented by 1 for each consecutive message.
49 SenderCompID String
The identifier of the message sender. Provided by B2PRIME.
52 SendingTime Timestamp
The date and time when the message was sent, in UTC: YYYYMMDD-HH:MM:SS.sss.
56 TargetCompID String
The identifier of the message recipient. Provided by B2PRIME.
Standard Trailer
All FIX messages must end with a Standard Trailer:
10 CheckSum int
A three-digit checksum. Always the last field in a message.
Logon (A)
This message is sent by the client to initiate a FIX session. It must be the first message in each connection.
1 Account String
The account identifier. Required. Provided by B2PRIME.
98 EncryptMethod int
The encryption method. Required. Must be 0 (no encryption).
108 HeartBtInt int
The heartbeat interval, in seconds. Required. Indicates how often the server sends Heartbeat messages as part of a connection health check.
141 ResetSeqNumFlag Boolean
Indicates whether both parties should reset the currently used sequence numbers. Optional.
553 Username String
The client username. Required. Provided by B2PRIME.
554 Password String
The client password. Required. Provided by B2PRIME.
Session maintenance
Heartbeat (0)
This message is sent back and forth between the server and the client to check the connection status and in response to Test Request messages.
112 TestReqID String
The identifier of a Test Request in response to which this Heartbeat is sent. Required when the Heartbeat is a response to a Test Request.
Test Request (1)
This message is sent back and forth between the server and the client as a means of connectivity check. If a Heartbeat is not received within the expected interval, a Test Request is sent; the recipient must respond with a Heartbeat containing the same <112> TestReqID.
112 TestReqID String
The identifier of a Test Request. Optional.
Sequence Reset (4)
This message indicates the sequence number of the next message from the sender, immediately following the Sequence Reset. This may be necessary to recover from a disconnect when some messages were lost or their resending is not desirable.
123 GapFillFlag Boolean
Indicates that this message replaces missing messages that won't be resent. Optional.
Possible values:
Y— Gap fill:<34>MsgSeqNum is valid and indicates the beginning of the gap fill rangeN— Sequence reset:<34>MsgSeqNum is ignored. Should only be used in disaster recovery situations
36 NewSeqNo int
The new sequence number. Required.
Logout (5)
This message is sent by the client or server to terminate a session. When terminated, the possible reason is specified in the <58> Text field.
58 Text String
The detailed information about the reason for logging out. Optional.
Reject (3)
This message is sent by the server upon receiving a malformed message from the client. The rejection reason is specified in the <373> SessionRejectReason field.
This message is unrelated to application-level rejections (Market Data Request Reject and Business Reject).
45 RefSeqNum int
The sequence number of the rejected message (<34> MsgSeqNum). Required.
371 RefTagID int
The tag number of the field that caused message rejection. Optional.
372 RefMsgType String
The type of the rejected message (<35> MsgType). Optional.
373 SessionRejectReason int
The reason why the message is rejected. Optional.
Possible values:
0— Invalid tag number1— Required tag missing2— Tag not defined for this message type3— Undefined tag4— Tag has no value assigned5— Value is incorrect (out of range) for this tag6— Incorrect value data format7— Decryption issue8— Signature problem9— CompID issue10— SendingTime accuracy issue11— Invalid MsgType12— XML validation error13— Same tag appears more than once14— Tag specified not in required order15— Wrong order of repeating group fields16— Incorrect NumInGroup count for repeating group17— Non-"Data" value includes field delimiter (SOH character)99— Other
58 Text String
The detailed information about the rejection reason. Optional.
Market Data Request (V)
This message is sent by the client to subscribe to real-time quoting data for a specified ticker symbol.
After subscribing, the server sends an initial Market Data — Snapshot/Full Refresh, followed by continuous Market Data — Incremental Refresh messages with each market data update.
To subscribe to multiple symbols, send a separate Market Data Request for each symbol. To unsubscribe, send a Market Data Request with <263> SubscriptionRequestType set to 2. All subscriptions are also terminated when the session is closed via Logout.
262 MDReqID String
The identifier of the Market Data Request. Required. Must be unique for the duration of each session. When unsubscribing, specify the ID of a previous request to discard.
263 SubscriptionRequestType int
The type of response expected from the server. Required.
Possible values:
1— Subscribe: receive updates as the market status changes2— Unsubscribe: stop streaming market data for the specified symbol
264 MarketDepth int
The market depth for an order book snapshot. Required.
Possible values:
0— Full order book1— Top-of-the-book prices
265 MDUpdateType int
The update type. Required. Must be 1 (incremental updates for changed price levels only).
267 NoMDEntryTypes int
The number of <269> MDEntryType entries requested. Required.
Repeating group:
269 MDEntryType int
The side of the quote. Required.
Possible values:
0— Bid1— Ask
146 NoRelatedSym int
The number of ticker symbols. Required. Must be 1. To subscribe to multiple symbols, send a separate request for each.
Repeating group:
55 Symbol String
The market identifier. Required. Format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: cfd.eth_eur.
Market Data — Snapshot/Full Refresh (W)
This message is sent by the server after the client subscribes to a ticker symbol. It contains the full current state of the order book. Subsequent updates are delivered as Market Data — Incremental Refresh messages.
55 Symbol String
The market identifier. Format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: cfd.eth_eur.
262 MDReqID String
The identifier of the originating Market Data Request.
268 NoMDEntries int
The number of market data entries following. The value is 0 if the order book is empty.
Repeating group (present when
<268>NoMDEntries > 0):
269 MDEntryType int
The side of the quote. Conditional — required if <268> NoMDEntries is not 0.
Possible values:
0— Bid1— Ask
270 MDEntryPx Price
The price of the market data entry. Conditional — required if <268> NoMDEntries is not 0.
271 MDEntrySize Qty
The tradable volume of the market data entry. Conditional — required if <268> NoMDEntries is not 0.
278 MDEntryID String
A unique market data entry identifier. Conditional — required if <268> NoMDEntries is not 0.
Market Data — Incremental Refresh (X)
This message is continuously sent by the server after the initial Snapshot/Full Refresh. Each message includes only the changes since the previous update.
55 Symbol String
The market identifier. Format: {marketType}.{baseAssetId}_{quoteAssetId}, for example: cfd.eth_eur.
262 MDReqID String
The identifier of the originating Market Data Request.
268 NoMDEntries int
The number of market data entries following. The value is 0 if the order book is empty.
Repeating group (present when
<268>NoMDEntries > 0):
269 MDEntryType int
The side of the quote. Conditional — required if <268> NoMDEntries is not 0.
Possible values:
0— Bid1— Ask
270 MDEntryPx Price
The price of the market data entry. Conditional — required if <268> NoMDEntries is not 0.
271 MDEntrySize Qty
The tradable volume of the market data entry. Conditional — required if <268> NoMDEntries is not 0.
278 MDEntryID String
A unique market data entry identifier. Conditional — required if <268> NoMDEntries is not 0.
Must be unique among active entries when
<279>MDUpdateAction is0(New)Must match the previous
<278>MDEntryID when<279>MDUpdateAction is1(Change) or2(Delete)
279 MDUpdateAction int
The update type. Conditional — required if <268> NoMDEntries is not 0.
Possible values:
0— New1— Change2— Delete
58 Text String
Additional context. Optional.
Market Data Request Reject (Y)
This message is sent by the server to reject a Market Data Request due to business or technical reasons.
262 MDReqID String
The identifier of the rejected Market Data Request. Required.
281 MDReqRejReason int
The reason why the request is rejected. Optional.
Possible values:
0— Unknown symbol1— Duplicate MDReqID2— Insufficient bandwidth3— Insufficient permissions4— Unsupported SubscriptionRequestType5— Unsupported MarketDepth6— Unsupported MDUpdateType8— Unsupported MDEntryType
58 Text String
The detailed information about the rejection reason. Optional.
Business Reject (j)
This message is sent by the server to reject a message due to a business-level issue not addressed by the standard Market Data Request Reject or session-level Reject.
45 RefSeqNum int
The sequence number of the rejected message (<34> MsgSeqNum). Required.
372 RefMsgType String
The type of the rejected message (<35> MsgType). Optional.
380 BusinessRejectReason int
The reason why the request is rejected. Required.
Possible values:
0— Other1— Unknown ID2— Unknown Security3— Unsupported MsgType4— Application not available5— Conditionally required field missing6— Not authorized7— DeliverTo firm not available at this time
58 Text String
The detailed information about the rejection reason. Optional.
Last updated
Was this helpful?

