FIX Messaging

by Kevin Lin

1

What I will talk about

  • This tech talk is for engineers with little or no prior knowledge on FIX.
  • To provide a basic understanding of FIX messaging standard, structure, system architecture and the programming model.
2

What is FIX?

3
left, fit right, fit
4

Financial Information eXchange

A electronic communications protocol for international real-time exchange of securities transaction information.

Used by the FIX community which includes nearly 300 member firms including all major investment banks.

The de-facto messaging standard for front office messaging. It is used for pre-trade, trade, and post-trade communication.

5

Characteristic of FIX

  • Simple, plain text, field-based text messages
  • Platform and Transport independent, compatible with almost every common network technology
  • Public standard
    • Owned & managed by FIX Protocol Ltd, a non-profit financial community organization
  • Wide support and lots of software vendors availability
6

> The FIX Protocol was originally authored in 1992 to enable electronic communication of equity trading data between Fidelity Investments and Salomon Brothers.

  • - by Robert "Bob" Lamoureux and Chris Morstatt
7

Fidelity realized that information from their broker-dealers could be routed to the wrong trader, or simply lost when the parties hung up their phones.

It wanted such communications to be replaced with machine-readable data

8

Strict syntax, machine parsable while remain textual

Extensible, support all current and future trading activities

Concise, use less characters to conserve bandwidth

JSON? No good way to enforce syntax/schema Protobuf? Probobaly

9

Buy 5000 IBM @ 110.75

10

Buy 5000 IBM @ 110.75

[A fund manager] tells [A broker] I'm willing to Buy 5000 units of IBM shares at the price of 110.75 dollars right now

11

Buy 5000 IBM @ 110.75

[A fund manager] tells [A broker] I'm willing to Buy 5000 units of IBM shares at the price of 110.75 dollars right now

  • Replace each piece of information with a field/tag, identified by a decimal number
  • And add additional fields/tags required by machine
12

Buy 5000 IBM @ 110.75

8=FIX.4.2^9=251^35=D^49=AFUNDMGR^56=ABROKER^34=2^52=20030615-01:14:49^11=12345^21=1^55=IBM^54=1^60=2003061501:14:49^38=5000^40=2^44=110.75^10=127

| Header fields | Body fields | Trailer Fields | --- | --- | --- | | 8=BeginString (indicates FIX 4.2) | 11=ClOrderID (client order id) | 10=Checksum | | 9=BodyLength (251) | 21=HandleInst (automated exec) | | | 35=MsgType (new order) | 55=Symbol (IBM) | | | 49=SenderCompID (AFUNDMGR) | 54=Side (buy) | | | 56=TargetCompID (ABROKER) | 60=TransactTime (2003061501:14:4952) | | | 34=MsgSeqNum (2) | 38=OrderQty (5000) | | | 52=SendTime (20030615-01:14:49) | 40=OrdType (Limit) | | | | 44=Price (110.75) | |

13

Buy 5000 IBM @ 110.75

##### 8=FIX.4.2^9=251^35=D^49=AFUNDMGR^56=ABROKER^34=2^52=20030615-01:14:49^11=12345^21=1^55=IBM^54=1^60=2003061501:14:49^38=5000^40=2^44=110.75^10=127

| Header fields | Body fields | Trailer Fields | --- | --- | --- | | 8=BeginString (indicates FIX 4.2) | 11=ClOrderID (client order id) | 10=Checksum | | 9=BodyLength (251) | 21=HandleInst (automated exec) | | | 35=MsgType (new order) | 55=Symbol (IBM) | | | 49=SenderCompID (AFUNDMGR) | 54=Side (buy) | | | 56=TargetCompID (ABROKER) | 60=TransactTime (2003061501:14:4952) | | | 34=MsgSeqNum (2) | 38=OrderQty (5000) | | | 52=SendTime (20030615-01:14:49) | 40=OrdType (Limit) | | | | 44=Price (110.75) | |

14

FIX message structure

  • Header fields
    • message type, length, sequence number, sender/target, encoding, etc.
  • Body fields
    • session & application data
  • Trailer fields
    • Signature, checksum
15

Message fields

  • For each field = the specification defines:
    • Tag – A unique number.
    • Field Name – Field name with no spaces.
    • Required - Mandatory/optional
    • Description – Definition of data, data type, etc.
  • `` is ASCII SOH character
16

A brief history of FIX

  • Introduced in 1992
  • 1995 - first public spec (FIX 2.7) released
  • 1996 - FIX 4.0
    • Introduced with good US equity support (still in use in US)
  • 2000 – FIX 4.2
    • Better international support
    • Futures, options, FX
  • 2001 – FIX 4.3
    • Fixed income
  • 2003 – FIX 4.4
    • Confirmations & trade reporting
  • 2006 – FIX 5.0 & FIXT1.1
    • Complex FX, improved session/transport level
17

Who uses FIX?

  • Institutional investors (the buy side)
  • Broker/dealers (the sell side)
  • Exchanges & Electronic Communication Networks (ECN)
  • Financial industry utilities
  • Software & services vendors
18

What/where is it used?

  • Financial Products Supported
    • Equities
    • Fixed Income
    • FX
    • Derivatives (Options, Futures, IR Swaps etc)
  • Used worldwide
-text">-
19

What/where is it used?

  • Financial Products Supported
    • Equities
    • Fixed Income
    • FX
    • Derivatives (Options, Futures, IR Swaps etc)
  • Used worldwide
    • Except mainland China :cn: :sin:"
20

How is it used?

  • Used by exchanges, ECN, & brokers/ dealers to distribute market data, quotes, etc.
  • Money mangers use it to send orders and receive executions from brokers.
  • Used by exchanges & ECNs to receive orders or quotes & report trades.
  • Used to allocate & confirm trades.
21

Variant of FIX

  • tagvalue (classic FIX)
  • FAST - FIX Adapted for Streaming
    • Binary encoding for reduced bandwidth use and low latency
  • FIXML - XML
22

Typical FIX system architecture

inline
23

Typical FIX system connectivity

35%, inline
24
75%, inline
25

`8=FIXT.1.1^A9=908^A35=y^A49=FIXEDGE^A56=UILNDRGW1^A34=2239^A52=20170309-11:41:49.132^A560=0^A393=1^A320=23387919276913833^A322=23387919276913833_37^A1151=NDF.AFRICA^A893=Y

26

FIX Versioning

FIX currently supports three versions of the application messages that serve as the basis for standardization:

  1. Version 5.0 Service Pack 2
  2. Version 4.4
  3. Version 4.2
**_FIX.5.0SP2_** is the most current version of FIX that supports multiple asset classes and a wide range of trading life cycle business processes. 
The FIX session protocol was separated from the application with the introduction of FIX.5.0
**_FIX.4.4_** is one of the most widely adopted versions oF FIX. FIX.4.4 covers multiple asset classes including fixed income instruments. As of 2010, it is considered compliant to use fields, messages, and components as of the latest extension pack of FIX with FIX.4.4.
**_FIX.4.2_** is widely used for equities, FX, and listed derivatives trading.
27

FIX tag number space

  • Public fields (tagNum < 5000)
    • Reserved for standard specifications or extentions
  • User defined fields (5000 <= tagNum < 9999)
  • User defined fields (10,000 <= tagNum <= 39999)
    • For bilateral user between parties, do not need to be registered
28

Session & application layers

  • Session layer/protocol
    • Make & terminate connections
    • Deliver messages in sequence w/ data integrity
  • Application layer
    • Business level messages
  • Session & application layers are coupled prior FIX 5.0.
29

Session Level Messages

  1. Logon
  2. Heartbeat
  3. Test Request
  4. Resend Request
  5. Reject
  6. Sequence Reset
  7. Logout
30

Application Messages

  • Pre-trade messages
    • Market Data
    • Security Info etc
  • Trade messages
    • Single Orders / Basket/List Orders / Multi-leg orders
    • Execution Reports
    • Order Cancel/Replace
    • Status etc
  • Post-Trade messages
    • Allocations
    • Settlement Instructions
    • Positions Management etc
31
32

QuickFIX Family

33

Create and send FIX message in OO way

import quickfix.*;

void sendOrderCancelRequest() throws SessionNotFound
{
  quickfix.fix41.OrderCancelRequest message = new quickfix.fix41.OrderCancelRequest(
	new OrigClOrdID("123"),
	new ClOrdID("321"),
	new Symbol("LNUX"),
	new Side(Side.BUY));

  message.set(new Text("Cancel My Order!"));

  Session.sendToTarget(message, "TW", "TARGET");
}    
34

Key things to take note working on FIX systems

  1. FIX systems are generally high-throughput, low-latency systems, design ahead
  2. High availability, i.e. failover, auto-recovery are usually hard requirement
  3. To protective in coding to handle unexpected message scenarios
  4. Message logs are the source of truth when there is a problem
35

Thank you! ❤️

inline, original
36
37