The Financial Information Exchange (FIX) protocol emerged in the 1990s as a standardized means for financial firms to communicate. Unlike proprietary solutions, FIX offers a global standard, promoting interoperability.
The FIX protocol is a text-based, transport-agnostic protocol extensively employed by financial institutions for order transmission, execution report receipt, and market data dissemination. With various versions available, institutions typically tailor a specific FIX version to suit their unique requirements and use cases. Most of the communication between exchanges, brokers, banks and other financial institutions takes place using FIX.
Though FIX Protocol Ltd/FIX Trading Community supervised the protocol's development, they did not produce or market FIX engines; instead, they provided the blueprint for others to create them.
A FIX engine serves as middleware between your enterprise and that of your business partners, facilitating message exchange. It manages network connections, sends and receives FIX messages, and validates their adherence to the FIX format. Numerous FIX engine providers, both commercial and open-source, offer various functionalities. QuantXpress stands out in this domain with its QX.FIX Engine, enabling businesses to harness FIX's power for streamlined communication and a competitive edge in the financial market.
Initially, the sole option for utilizing a FIX engine involved developing a custom solution (commercial versions followed suit). Dubbed a "FIX Engine," this software component facilitated connection and communication using the FIX protocol. However, due to variations in interpretation and implementation of the protocol, disagreements arose, particularly during testing phases regarding message resending and correction responses.
The FIX engine facilitates low-level communication and FIX message encoding/decoding (parsing). Typically leveraging the TCP/IP protocol, FIX engines establish connections by either initiating or accepting them. Traditionally, investment managers (buy-side) act as initiators, while broker/dealers (sell-side) serve as acceptors. A critical function of the FIX engine involves managing network connection, sending, receiving, validating and replaying messages, ensuring sequential and ordered message processing, Persist FIX session state. Additionally, the engine must incorporate logic to handle missing messages for seamless recovery.
At the heart of this communication lies the FIX message, a structured format that carries vital information between trading platforms and participants. Let's delve into the anatomy, construction, and significance of these FIX messages.
FIX messages follow a key-value pair format, containing information for a transaction state. Tags correspond to fields in the FIX specification. Each message comprises a header, body, and trailer.
1.Header: Acting as the introduction, the header contains vital details such as the version of the FIX protocol being employed (e.g., FIX.4.2), the total length of the message (excluding the header and trailer), and the message type (e.g., order, execution report). The important tags in FIX message header sections are:
Here are some important tags commonly found in the header section:
| Tag | Field Name | Description |
|---|---|---|
| 8 | BeginString | This tag denotes the version of the FIX protocol being employed. For example, "8=FIX.4.2" indicates the utilization of FIX version 4.2. |
| 9 | BodyLength | The BodyLength tag specifies the total length of the message, excluding the header and trailer sections. It ensures accurate message parsing and processing. |
| 35 | MsgType | The MsgType tag delineates the type of message being transmitted, such as order, execution report, or cancel request. It plays a pivotal role in message routing and interpretation. |
| 49 | SenderCompID | This tag identifies the sender of the message, typically denoting the unique identifier or code assigned to the sender's system or entity. |
| 56 | TargetCompID | The TargetCompID tag specifies the intended recipient or destination of the message, indicating the unique identifier or code assigned to the recipient's system or entity. |
| 34 | MsgSeqNum | The MsgSeqNum tag denotes the sequence number of the message, facilitating message sequencing and ensuring message integrity and order. |
| 52 | SendingTime | This tag indicates the timestamp of when the message was generated or transmitted, enabling synchronization and time-based processing across different systems. |
2.Body:Serving as the essence of the message, the body carries specific data pertinent to the message type. Depending on the message type, the body may include details such as order quantity, security identifier, price, and timestamps.
3.Trailer:Functioning as the closing segment, the trailer contains a checksum value. This checksum is calculated based on the entirety of the message content and acts as a vital security measure to ensure data integrity during transmission.
Each FIX message is a sequence of tag-value pairs, separated by a special character (SOH - Start of Header). Tags are numerical identifiers representing specific data points (e.g., tag 8 represents BeginString, tag 55 represents Symbol). Values correspond to the data associated with each tag. For instance, the tag-value pair "55=MSFT" indicates the message pertains to the security with the symbol "MSFT" (Microsoft).
A FIX message adheres to a standard format, commencing with the header, followed by the message body fields, and concluding with the trailer. The header typically includes tags like BeginString (tag #8), BodyLength (tag #9), and MsgType (tag #35), while the trailer culminates with the CheckSum (tag #10).
The tag value pair represent a Field. Each FIX message is composed of a sequence of such pairs, tag being the field and value being the value associated with that field in the pair. Each tag-value pair is delimited by an ASCII control character i.e. 0X01. Each tag has its own meaning. The definition of a field within a FIX message comprises four key components:
Name: This provides a human-readable description of the field's purpose within the FIX protocol. It acts as a label, offering clear context for what the field represents.
Number(Tag): Each field is assigned a unique numerical identifier known as a tag. Tags are integral to FIX messaging, enabling standardized communication and interoperability between different systems and counterparties. For instance, the tag "8" represents the BeginString field in FIX protocol specifications.
Data Type: The data type specifies the format and nature of the data contained within the field. Common data types in FIX messaging include strings, integers, floats, dates, and more. Understanding the data type is essential for accurately parsing and interpreting the field's value. In the example of the BeginString field, the data type is "String," indicating that the value represents a textual string.
Value: The The actual value associated with the field in a particular message instance conveys specific information relevant to the message context. Values are often delimited by ASCII control characters, such as 0X01, for clear demarcation within the message. For instance, the value "FIX.4.4" in the BeginString field indicates the protocol version being utilized, providing essential information for message processing and interpretation.
Let's examine the BeginString field as an example to elucidate the concept of field definitions:
Name: BeginString
Number: 8
Data Type: String
Value: FIX.4.4
Let's examine a sample raw FIX message and decipher its contents:
| Field | Tag | Value | Meaning |
|---|---|---|---|
| BeginString | 8 | FIX.4.4 | Indicates that the message adheres to the FIX protocol version 4.4. |
| BodyLength | 9 | 110 | Specifies the total length of the message body, excluding the header and trailer sections. |
| MsgType | 35 | D | Indicates that this message is an Order Single. The 'D' represents an order to buy or sell a security. |
| MsgSeqNum | 34 | 3 | Denotes the sequence number assigned to this message, facilitating proper sequencing and order management. |
| SenderCompID | 49 | CLIENT | Identifies the sender of the message, in this case, the client's unique identifier or code. |
| SendingTime | 52 | 20190424-11:19:16.885 | Specifies the timestamp when the message was generated or transmitted by the sender. |
| TargetCompID | 56 | SERVER | Identifies the recipient or target of the message, in this case, the server's unique identifier or code. |
| ClOrdID | 11 | ID | Represents the Client Order ID, a unique identifier assigned by the client to this particular order. |
| HandlInst | 21 | 3 | Indicates the type of order handling instruction, specifying how the order should be executed or processed. |
| OrdType | 40 | 1 | Specifies the order type, where '1' typically represents a market order. |
| Side | 54 | 1 | Indicates the side of the order, where '1' typically represents a buy order. |
| Symbol | 55 | EUR/USD | Identifies the financial instrument being traded, in this case, the Euro/US Dollar currency pair. |
| TransactTime | 60 | 20190424-11:19:16.885 | Specifies the timestamp when the transaction occurred, ensuring accurate recording and synchronization. |
| CheckSum | 10 | 054 | Represents the checksum value calculated for the entire message, ensuring data integrity during transmission. |
Another Example
In this example:
Tag 8 represents the FIX protocol version.
Tag 9 denotes the length of the message.
Tag 35 indicates the message type (e.g., 'A' for Logon).
Tags like 49 and 56 may represent sender and target identifiers, respectively.
Tag 10 serves as the checksum to ensure data integrity.
In this example:
We start counting from the beginning, including tag 35 (MsgType).
We continue counting until we reach, but do not include, tag 10 (Checksum).
The total count, including SOH delimiters, is 65 characters.
Therefore, the body length of this FIX message is 65.