FIX (Financial Information Exchange) is a protocol for (financial) securities-related communication. FIX specifies a presentation- and application-layer protocol: it dictates how messages can be encoded, and what their contents can be. In many use cases FIX is like the electronic version of the open outcry and post-it note passing of trading prior to electronification: it handles messaging between traders, exchanges, custodians, clearinghouses, and the other entities involved in securities markets.
Over 10TB of FIX data are generated daily, ranging from security definitions to orders to market data.
Here's an example of how people use FIX: you, a registered representative at $INVESTMENT_FIRM
, want to place a trade in AAPL
. You open a ticket in your trading platform; then you enter a quantity, side, a few other parameters, and hit SUBMIT
.
Your trading platform sends a FIX message to $BROKERDEALER
:
8=FIX.4.4 | 9=148 | 35=D | 34=1080 | 49=TESTBUY1 | 52=20180920-18:14:19.508 | 56=TESTSELL1
| 11=63673064027889863415=USD21=2 | 38=7000 | 40=1 | 54=1 | 55=AAPL |
60=20180920-18:14:19.492 | 10=092 |
This is a plaintext ASCII message. Your trading platform sends it over TCP/IP to a FIX server in $BROKERDEALER
's server farm in New Jersey. The message encodes all the relevant information about this buy order in tag-value format: a tag is a specific field in the FIX schema, and a value is whatever value your trading platform assigned to that tag. For example,
35=D
tells $BROKERDEALER
's FIX server that the incoming message is a FIX NewOrderSingle
, or a new order in a single security; application developers might refer to this tag as MsgType(35)
.55=AAPL
(Symbol(55)
) tells $BROKERDEALER
's FIX server that the new order is for symbol AAPL
.38=7000
means that this order is for quantity 7000
(shares) of AAPL.8=FIX4.4
and 9=148
give the FIX schema version (4.4) and body length, respectively. Body length is the number of characters in the message, including deliimiters and excluding tags 8
, 9
, and 10
.10-092
is the FIX checksum, which validates and terminates any FIX message. The checksum is the sum of all bytes in the message, mod 256.34=1080
is the sequence number. Sequence numbers should always be incremented by 1 between messages; a dropped sequence number indicates that messages were missed, in which case some FIX engines will automatically send a ResendRequest(7)
to ask for the missing message(s).This message format is sufficient for most use cases. Sometimes, ASCII-encoded and pipe-delimited messages (or XML for that matter) are too heavy. At the presentation-layer there are other ways to encode FIX messages (e.g. Simple Binary Encoding).
Regardless of encoding, the FIX protocol assumes ordered delivery of messages -- that is, $BROKERDEALER
's FIX server assumes it will receive messages in the order that $INVESTMENT_FIRM
's trading platform sent them. Ordered delivery (or session failure) is guaranteed by a combination of sequence numbers and Ack
/Response
messages.
Some things have to happen so that you, registered representative at $INVESTMENT_FIRM
, can hit SUBMIT
in trading platform and expect an order to be placed. Sometime early in the morning, your trading platform probably initiated a FIX session with $BROKERDEALER
's FIX server by sending a Logon(A)
message:
8=FIX.4.2|9=76|35=A|49=BuySide|56=SellSide|34=1|52=20190605-11:27:06.897|98=0|108=30|141=Y|10=008|
Tag HeartBtInt(108)
specifies the interval, in seconds, between heartbeat messages.
The FIX protocol plays a crucial role throughout the entire trade processing lifecycle, from the initial order placement to the final settlement:
Order Origination:
Order Routing:
Order Execution:
Confirmation and Allocation:
Clearing and Settlement:
Post-Trade Reporting: