Introduction to the FIX Protocol for Developers

author
By FIXParser

2025-01-01

FIX Specification

As a TypeScript / front-end developer, you’re no stranger to building scalable, maintainable applications. But what if you were to step into the world of finance, where systems need to communicate high-frequency trade data, execute orders, and provide real-time updates? One of the key protocols enabling this exchange of information is the FIX Protocol (Financial Information eXchange). Whether you're tasked with integrating a trading system or building financial software, understanding FIX is crucial.

What is the FIX Protocol?

The FIX Protocol is a messaging standard used to facilitate the electronic exchange of financial data. It was developed in the late 1980s to enable real-time communication between stock exchanges, brokers, and other market participants. FIX provides a way to send and receive orders, trade execution information, and market data, all in a structured, standardized format.

Why Should TypeScript Developers Care About FIX?

As a TypeScript developer, you’re accustomed to working with APIs, structured data, and high-performance systems. The FIX Protocol operates in a similar way, but it deals with very specific requirements:

  • Performance: FIX messages must be processed quickly to handle high volumes of transactions.
  • Standardization: FIX uses a standardized message format to ensure systems can communicate seamlessly, even if they are using different technologies.
  • Real-time Data: Financial markets are fast-paced, and FIX is designed to handle real-time data exchanges, including price updates, trade executions, and order statuses.

FIX Protocol Structure

A FIX message consists of a series of fields, each identified by a tag (a number). Fields can contain various types of data, such as text, numbers, or timestamps. These messages are encoded in a simple, plain-text format and can be transmitted over different transport layers, such as TCP/IP, WebSockets, or even FIX-specific network protocols.

For example, here’s a very basic FIX message for a new order:

Key Components of a FIX Message:

A FIX message consists of a series of fields, each identified by a tag (a number). Fields can contain various types of data, such as text, numbers, or timestamps. These messages are encoded in a simple, plain-text format and can be transmitted over different transport layers, such as TCP/IP, WebSockets, or even FIX-specific network protocols.

  • Begin String 8=FIX.4.2 Identifies the FIX version used.
  • Message Type 35=D Indicates the type of message (e.g., order, execution report, etc.).
  • Sender and Target Comp IDs 49=Broker, 56=Exchange Identifies the sender and receiver of the message.
  • Order Details (e.g., 11=12345 is the unique order ID, 55=AAPL is the symbol, 38=100 is the quantity).
  • Checksum 10=234 Ensures the integrity of the message.

FIX Message Types

There are several types of FIX messages, and each serves a specific purpose in financial transactions. Some of the most commonly used types are:

  • New Order - Single35=D Used to submit a new order.
  • Execution Report35=8 Reports the status of an order (e.g., filled, rejected).
  • Order Cancel35=F Used to cancel an existing order.
  • Market Data Snapshot35=W Used to send price and market data updates.

These message types are just a few examples of the hundreds of message types defined in the FIX specification.

FIX Message encoded as JSON

Our TypeScript library now includes full support for encoding FIX Protocol messages in JSON. Designed with web applications in mind, JSON encoding provides a lightweight and human-readable alternative to traditional FIX formats like tagvalue, FIXML, and others. Encoding FIX messages requires FIXParser Pro. Here's an example of the above NewOrderSingle message encoded as JSON using the .toFIXJSON() function: