Skip to content
All library documents

Reconstructing the Best Bid and Ask from NASDAQ ITCH Messages

Article Quant Q&A · Author: Tontho

Summary

The document describes how to recover the best bid and ask from NASDAQ TotalView-ITCH order data. The core method is to process the feed sequentially and maintain an order book: messages add orders, modify or cancel them, or report other activity. Once the displayed orders have been applied, the highest-priced bid and lowest-priced ask at the top of the book provide the prevailing quotes.

The response notes that most messages represent an order or an action on one, while some system messages and non-displayed trade messages do not directly contribute to the displayed book. It also points out that the amount of data matters for implementation: processing a few stocks over a short period may be manageable in a slower tool, while larger workloads may call for a faster language. The document does not specify timestamp alignment or how to produce one record per millisecond. That sampling choice and the handling of feed details would need to be defined by the researcher.

Key ideas

  • Best quotes can be reconstructed by applying ITCH messages to an order book in sequence.
  • The best bid is the highest displayed buy price, and the best ask is the lowest displayed sell price.
  • Most order and order-action messages affect the book, while some system and non-displayed trade messages do not.
  • The appropriate processing tools depend on the number of stocks and days being analyzed.
  • The document does not explain how to map quote updates to a fixed millisecond grid.

Tags

Full text
# constructing best bid/ask from NASDAQ TotalView-ITCH data


# constructing best bid/ask from NASDAQ TotalView-ITCH data












anybody know how to construct a intraday stock price from NASDAQ TotalView-ITCH data?

I would need to know the price in millisecond, so I would need two rows: timestamp (for every millisecond) and price (best bid/ask)

Thanks for any help!

## Answer by Louis Marascio (score 3)

https://quant.stackexchange.com/a/9574

To construct best bid/ask from ITCH you must build a book incrementally from the messages in the data. Every message, except for system oriented messages, and non-displayed Trades, represent an order or an action on an order. Process the data, build a book, and you will naturally be left with the best bid/ask at the top of each side.

## Answer by CharlesM (score 0)

https://quant.stackexchange.com/a/9580

No choice to construct the book. Now the decision you have to make is for how many stocks you want to compute the bid-ask spreads and for how many days. You can use SAS but it is slow - so it may be fine for a few stocks on one day. Otherwise, Python is the best alternative (or C++).

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.