Order Book

What is an order book?

The order book is an aggregated list of all the current, unmatched orders in the market. It shows the volume on the bid and ask at the different price levels. Some markets allow for traders to see the full order book where there is a breakdown of each of the orders on a given price level.

What is an exchange?

An exchange is really just a forum which people electronically connect to in order to buy or sell financial instruments. A relatable example is eBay – where anyone can register to buy or sell almost anything. But there are a few major differences:

  • Exchanges list financial instruments, rather than physical goods.
  • The contract terms of these instruments are set and standardised by the exchange, rather than the seller of the instrument.
  • Most individuals connect to the exchange through a broker (like Commsec), rather than directly.
  • Regulation is much tighter. There are many rules everyone needs to abide by to ensure the markets are fair and orderly.

At the most basic level, we can think of the exchange as a computer program where market participants place orders and the exchange’s matching engine ‘matches’ them, resulting in trades between two counterparties.

What is an order?

An order (specifically a limit order) is simply an indication of willingness to trade, consisting of:

  • Side → BUY or SELL
  • Price → the maximum (minimum) price at which you are willing to buy (sell)
  • Volume → the number of units (or “lots”) that you want to trade
  • Type/Lifespan → indicates how long the order is valid before automatic cancellation

There are two different order types (lifespans): ‘fill-and-kill’ and ‘good for day’.

Types of order

Fill-and-kill (FAK) order type/lifespan

The matching engine will attempt to match the order against existing orders in the market.

Any order volume that does not trade immediately is instantly cancelled.

For example, imagine there is an offer in the market for 1,000 lots at $10.12 and someone inserts a FAK bid for 2,000 lots to lift $10.12. A trade for 1,000 lots will occur at $10.12 and the remainder of the 2,000 lot bid will be extinguished unfilled.

Good for day (GFD) order type/lifespan

It is possible to insert, amend or cancel a GFD order. The order will remain in the order book until the end of the day, unless it trades or is cancelled.

Note that it is possible for the order to trade in small chunks at a time depending on supply/demand in the opposing direction (e.g. multiple buyers gradually filling a sell order); its volume will automatically be reduced until it’s fully traded.

Order Matching

  • Every time an order is inserted, amended or cancelled, the matching engine will update the order book according to the rule of price-time priority and check to see if any orders match.
  • A buy order matches a sell order if the price of the buy order is at least as high as the price of the sell order. When orders match, trades will be generated and the appropriate market information and execution messages will be sent to participants.
  • If GFD order volume is amended downwards, it will maintain its position in time priority. If amended upwards (i.e. increased), it will be sent to the back of the time-priority queue (anything else would be unfair)

Glossary

Amend: to modify the price or volume of an existing order. In Ready Trader One you can only reduce the volume of an order, you cannot change the price, side or type of an order. 
Ask:
 i) a SELL order, or ii) refers to the price of the lowest sell order in the market (i.e. the ask is $10.13).
Bid: i) a BUY order, or ii) refers to the price of the highest buy order in the market (i.e. the bid is $10.12).
Counterparty: refers to the person or company on the other side of a trade (e.g. “Optiver was my counterparty”). 
Execution: refers to messages between you and the exchange relating to your orders; e.g. you place an order by sending an “order insert” execution message, you are notified that you have traded via a “order filled” execution message etc.
Filled:
means “traded” – e.g. if you try to buy 1,000 lots but you only get 500, your order is said to be “partially filled”.
Hit:
means to “sell” – e.g. “hitting the bid” means crossing the spread to sell an existing buy order.
Lift: means to “buy” – e.g. “lifting the offer” means crossing the spread to buy an existing sell order.
Limit order:
an order with a limit price, i.e. a minimum or maximum price at which it’s willing to trade – as opposed to a market order.
Lots:
refers to the number of units / order volume (e.g. 1,000 lots means a quantity of 1,000 shares/futures/units).
Market order:
an order without a limit price, i.e. indicates willingness to buy or sell a specified volume at any price. Optiver recommends that you never use a market order.
Market information:
refers to public data disseminated by the matching engine about the state of the market, such as what orders are in the book and what trades have occurred.
Matching engine:
a computer program responsible for matching buy and sell orders to generate trades between counterparties.
Offer:
 same as ask.
Order book: a collection of orders arranged according to the rule of price-time priority.
Price-time priority: orders with a better price (higher bids and lower offers) are matched / allocated a trade first. If orders are at the same price, whichever one arrives at the matching engine first will be matched / allocated a trade first.
Spread: the distance/difference between the bid and ask.
Unfilled: not filled.