Introduction

View as MarkdownOpen in Claude

Market depth data, also known as level II, represents an instrument’s order book. Via the TWS API it is possible to obtain this information with the [EClient.reqMarketDepth](/tws-api/doc/market-data-live/market-depth-l-2/introduction) function.

Unlike [Top Market Data (Level I)](/tws-api/doc/market-data-live/top-of-book-l-1/request-watchlist-data), market depth data is sent without sampling or filtering, however we cannot guarantee that every price quoted for a particular security will be displayed. In particular, odd lot orders are not included.

It is possible to Smart-route a [EClient.reqMarketDepth](/tws-api/doc/market-data-live/market-depth-l-2/introduction) request to receive aggregated data from all available exchanges.

An integral part of processing the incoming data is monitoring [EWrapper.error](/tws-api/doc/error-handling/receiving-error-messages) for message 317 “Market depth data has been RESET. Please empty deep book contents before applying any new entries.” and handling it appropriately, otherwise the update process would be corrupted.

Market Depth is not support for Calendar Spreads or Combos.