Education

Introduction to FIX API Trading

FIX stands for Financial Information Exchange. FIX API is the primary messaging protocol used throughout the capital & money markets sector, and the foreign exchange market is completely dependent on the FIX API messaging protocol. 

The topic of APIs is no longer a far-reaching technical topic that only IT professionals and software and network engineers can grasp. API, which stands for application programming interface, is now a familiar term to most and is a cornerstone of the internet operating today. APIs are at the forefront of modern business today, and most business professionals are familiar with the concept. APIs are used to interconnect every type of business management system in practically every industry, including financial markets. 

APIs come in a variety of formats, structures and programming languages. There is a lot of flexibility in terms of what you can do via an API. The scope of functionality of an API reflects what is required to facilitate interaction with a specific system or platform. 

If you consider CRM systems such as HubSpot and Salesforce, they arguably both perform very similar functions, yet they will have individual and independent APIs. Because different organisations develop both CRM systems, they have unique APIs.

There is a growing trend of businesses within a common industry adopting the same API standards to facilitate interoperability. A prime example of this is the FIX API standard which was created to allow financial markets participants to communicate efficiently. 

Everyone from top tier market-making banks like Barclays, down to tech-savvy retail traders use FIX API for trading forex. Even if you’re a point and click trader, it’s almost certain that your trades are being processed via FIX API behind the scenes. 

In this article, we will provide an introduction to FIX API in the forex industry. Hopefully, this article will serve as the first step to determining if this utility will add value to your trading techniques.

The history of FIX API

In 1992, the concept of the FIX protocol was conceived at a time when brokers were still using phone-trading to receive orders and place orders. Manual phone-trading desks were highly inefficient and prone to human error. FIX API was responsible for enabling a smooth transition from old-school analogue trading methods to digital online trading.

The initial development was spearheaded by a few New York-based equities trading firms. Early adopters of the protocol included Fidelity Investments and Salomon Brothers, which was ultimately acquired by Citigroup. The initial version of FIX was developed to support pre-trade and trade operations for equities markets. 

Over the years, the scope of FIX API has extended tremendously. There are many versions of FIX messaging protocol in use, the latest being version 5.0. However, the most commonly used version in the forex community is version 4.4. 

Since then, the protocol has evolved to support the entire lifecycle of a financial transaction in various stages; the scope of FIX API covers everything from requesting and receiving quotes and market snapshots, submitting and modifying orders, trade settlements, and allocations. 

Today, FIX API remains the most widely used messaging protocol in the online trading industry. Despite being almost 30 years old, no significantly better, cheaper or faster alternatives have come close to challenging the dominance of FIX API. 

Who owns FIX API?

FIX API is a free, non-proprietary, and open protocol which is owned by a UK non-profit entity called FIX Protocol Ltd. Although companies can pay to enrol in the FIX trading community, membership is not obligatory, and anyone can start using the API for free. 

The FIX community ensures that the protocol remains free, forever. Companies choose to join the community to take part in workshops, lobby for new functionality and influence the roadmap of future development.

Unlike other comparable financial messaging systems, such as SWIFT, which charges a fee for each transaction processed by the network and generates hundreds of millions of euros in revenue each year, FIX API does not charge anything to users of the protocol. The primary difference between FIX API and SWIFT is that FIX is simply a protocol that can be used in peer-to-peer messaging. In contrast, SWIFT is a network that provides an infrastructure to support the exchange of messages. 

What markets does FIX API cover?

The FIX protocol is used for trading a wide variety of financial instruments and processing numerous related pre-trade and post-trade operations. The protocol covers everything from foreign exchange, global equities, futures, options, funds, bonds, and many other security types. According to the latest specification, there is even a security-code named ZOO which is apparently used for transacting Cats, Tigers & Lions; it’s unclear how popular this code is.

The protocol doesn’t just cover a wide and wonderful range of types of securities but also is used by a variety of participants, including stock exchanges, market-makers, broker-dealers, exchanges, and trading platforms.

The role of FIX API in the forex community

Numerous forex market participants, including banks, market-makers, prime brokers, prime of prime brokers, and ECNs all rely on FIX API for receiving and distributing liquidity. Besides sell-side firms, buy-side firms such as asset managers, hedge funds and corporations use FIX for receiving prices and submitting orders. The majority of technology solutions like trading platforms and price aggregators also comply with the FIX protocol. 

Besides institutional liquidity providing and trading firms, traders stand to gain a lot from connecting to the market via FIX API. Traders using stand-alone black box algorithmic trading systems or quantitative trading platforms and connect their proprietary systems to a FIX gateway.

FIX API offers the ability to consume vast amounts of data and in a structured way as well as submit different types of requests with the absolute minimum amount of latency possible.

How does FIX API work?

Rather than being strictly an API, FIX is a messaging protocol that was created specifically for transferring messages between two compatible parties who want to engage in buying or selling securities.

Most traders access the forex market via a platform offered by their broker—for example, MetaTrader 4, Currenex, cTrader or another application. However, when you trade through FIX API, there is no platform to interact with, which means you need to establish a connection to the recipient of the messages in another way. 

FIX API is a bi-directional, server-to-server messaging protocol. FIX users need to establish a connection using TCP via a predefined port to the host server. A FIX session is always initiated with a login message and terminated with a logoff message. There are many open-source libraries for building applications to connect with FIX API. The protocol is known to cooperate well with C++, C# and Java programming languages.

A FIX message is constructed of tags. Each tag determines the piece of information that should follow. Hundreds of different tags are supported. Despite FIX API covering a wide range of functionality, FIX users typically implement only the tags that are relevant and define them in a Rules of Engagement document to tell others what messages are available. 

This is what a logon message in FIX API version 4.4 using the cTrader rules of engagement looks like: 

8=FIX.4.4|9=126|35=A|34=1|49=theBroker.12345|57=TRADE|50=any_string|52=20170117-08:03:04|56=CSERVER|98=0|108=30|553=12345|554=passw0rd!|10=131|

When the message is parsed, this is what it means:

TAGTag NameValueDescription
8BeginString4.4The message (string) begins with identifying the FIX version that is being used. This message is using version 4.4.
9BodyLength102The length of the message (body) is 102 characters. This information helps to identify if parts of the message are missing.
35MsgTypeAThis tag identifies the message type. Value A is used to define logon messages. There are dozens of values available to identify message types.
34MsgSeqNum1This tag identifies the message sequence number, as it is a logon message; it is naturally the first message in the sequence. This value helps to discover if messages are missing.
49SenderCompI Dbroker.1047This tag identifies the party which is sending the message. The organisation receiving the message uses it to identify the sender.
57TargetSubIDTRADEThis tag is used to route the message to a particular recipient or role, for example, “QUOTE”, or “TRADE”.
50SenderSubIDQUOTEThis tag is used to identify the specific message creator.
52SendingTime20131129- 15:40:10.276The time of message transmission, for example, November 29th, 2013 (YYYYMMDD) at 15:40:10 and 276 milliseconds.
56TargetCompIDCSERVERThe target of the message, which in this example is CSERVER. 
98EncryptMethod0The tag identifies the type of encryption that will be used throughout the session. The first message must always be unencrypted. The value “0” means encryption is not used.
108HeartBtInt30A heartbeat can be sent from time to time to ensure the connection remains established. A setting of 30 means an interval of 30 seconds between heartbeats. If HeartBtInt is set to 0, no heartbeat message is required.
553Username1047The username or user ID. 
554PasswordMyPassword1The password for the trading account.
10CheckSum000Every FIX message is concluded with a CheckSum and must always be unencrypted. It is calculated by summing every byte of the message, excluding the checksum field itself, then transforming it into a modulo 256 number prefixed with “0” to receive a 3-digit number.

What are the advantages of trading with the FIX API?

For individual traders who are looking to gain an edge in the market, utilising FIX API could help you to access more information and faster order execution. Here are some of the main reasons why traders choose to trade directly with the FIX API. 

Low latency. FIX messages are lean in terms of how easy they are to generate, transmit and interpret, which reduces round-trip latency.

Lightweight. Because of the small size of messages, they require minimal bandwidth to transmit over the internet.

High frequency. Messages can be sent as frequently as hundreds of times per second.

Anonymity. If you have a proprietary trading system, it can be operated on your servers as opposed on shared trading platform servers.

Standardised. FIX API is widely accepted in the forex trading community, which means you can connect with multiple brokers concurrently or migrate easily as the need arises.

How to access FIX API trading

One of the quickest and easiest ways to access FIX API trading is via the cTrader platform. Anyone with a cTrader account can access their trading account via FIX sessions. One of the best features of using cTrader FIX API is that you can easily switch between API connection and a rich trading interface.

At Scandinavian Capital Markets, we design tailormade price feeds, which, when combined with FIX API trading, can give you a decisive edge. Besides the cTrader platform and it’s FIX gateway, we can distribute liquidity via multiple institutional platforms, which is something you can discuss with one of our relationship managers.