Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which are the order matching algorithms most commonly used by electronic financial exchanges?

Which are the order matching algorithms most commonly used by electronic financial exchanges? Is there a list of order matching algorithms somewhere?

like image 602
Kinnard Hockenhull Avatar asked Oct 28 '12 19:10

Kinnard Hockenhull


People also ask

Which algorithm is used for matching?

Hashing-string matching algorithms: Rabin Karp Algorithm: It matches the hash value of the pattern with the hash value of current substring of text, and if the hash values match then only it starts matching individual characters.

What is order matching in stock exchange?

Order Matching RulesThe best buy order will match with the best sell order. An order may match partially with another order resulting in multiple trades. For order matching, the best buy order is the one with highest price and the best sell order is the one with lowest price.

What is multilateral order matching system?

A multilateral trading facility (MTF) is a European term for a trading system that facilitates the exchange of financial instruments between multiple parties. MTFs allow eligible contract participants to gather and transfer a variety of securities, especially instruments that may not have an official market.

How does the Nasdaq matching engine work?

The matching engine sits at the core of the exchange, maintaining order books for the assets traded on the exchange. Buy and sell orders submitted by the market participants are matched into trades based on parameters such as price and quantity of the bids and offers in the orderbook.

What are the most widely used matching order algorithms?

However, the First-In-First-Out (FIFO) and Pro-Rata algorithms are the most widely used matching order algorithms. Matching orders is primarily the responsibility of market specialists and liquidity providers in the market. Matching occurs when buy and sell orders submitted for the same stock or security are close in terms of time and price.

What is the matching algorithm on electronic exchange?

The trading mechanism on electronic exchanges is an important component that has a great impact on the efficiency and liquidity of financial markets. The choice of matching algorithm is an important part of the trading mechanism. The most common matching algorithms are the Pro-Rata and Price/Time algorithms.

What is an order matching system?

Order matching at the heart of trading systems in Deutsche Börse. An order matching system or simply matching system is an electronic system that matches buy and sell orders for a stock market, commodity market or other financial exchange.

What are the most commonly used trading algorithms in the market?

There's quite a variety of algorithms for auction trading, which is used before the market opens, on market close etc. but most of the time, the markets do continuous trading. I'll therefore go into the latter category here. The most commonly used ones would be Price/Time priorityand Pro-Rata.


1 Answers

In general, there are two groups of matching algorithms, one for each of the states of the market:

  • Continuous trading
  • Auction

There's quite a variety of algorithms for auction trading, which is used before the market opens, on market close etc. but most of the time, the markets do continuous trading. I'll therefore go into the latter category here.

The most commonly used ones would be Price/Time priority and Pro-Rata. Both have been adapted and extended for various types of products and use cases, but for brevity, I'll only explain the basics here.


Price/Time priority, aka FIFO, ensures that

all orders at the same price level are filled according to time priority; the first order at a price level is the first order matched.

Say the order book, sorted by price and time looks like this:

Id   Side    Time   Qty   Price   Qty    Time   Side   ---+------+-------+-----+-------+-----+-------+------ #3                        20.30   200   09:05   SELL   #1                        20.30   100   09:01   SELL   #2                        20.25   100   09:03   SELL   #5   BUY    09:08   200   20.20                        #4   BUY    09:06   100   20.15                        #6   BUY    09:09   200   20.15                        

NB: The order for sorting by time is ascending for buy-side orders and descending for sell-side orders, so that the order with the highest priority is always in the center and priorities decrease outwards (up or down, depending on the side).

Now imagine a new limit order to "buy 250 shares at 20.35" comes in, then it will be filled, in this order:

  1. 100 shares at 20.25 (order #2)
  2. 100 shares at 20.30 (order #1)
  3. 50 shares at 20.30 (order #3)

This leaves the order book in the following state:

Id   Side    Time   Qty   Price   Qty    Time   Side   ---+------+-------+-----+-------+-----+-------+------ #3                        20.30   150   09:05   SELL   #5   BUY    09:08   200   20.20                        #4   BUY    09:06   100   20.15                        #6   BUY    09:09   200   20.15                        


Pro-Rata ignores the time the orders were placed and allots fill quantities to all orders at a price level according to their relative quantities. Take again the initial order book above, and let us match the same "buy [email protected]" order.

The fills would be:

  1. [email protected] (order #2, leaving 150)
  2. [email protected] (order #1, 150 x 1/3 = 50)
  3. [email protected] (order #3, 150 x 2/3 = 100)

Leaving the following order book like this:

Id   Side    Time   Qty   Price   Qty    Time   Side   ---+------+-------+-----+-------+-----+-------+------ #3                        20.30   100   09:05   SELL   #1                        20.30    50   09:01   SELL   #5   BUY    09:08   200   20.20                        #4   BUY    09:06   100   20.15                        #6   BUY    09:09   200   20.15                        


The CME group provides a list of matching algorithms they employ, and links to descriptions of each one.

For more, you might also want to take a look at the "Order matching" related documents on Rajeev's pages.

like image 122
Evgeniy Berezovsky Avatar answered Sep 20 '22 18:09

Evgeniy Berezovsky