Market Depth

R. Todd Gafford -

This sample demonstrates methods for requesting and processing market depth data. There is a link to download the sample at the end of this article.  Use the .zip file if you are using Windows, or the .tar file if you are using Linux.

Before you run the sample, you need to have the following:

  • Java Runtime Environment (JRE) 1.6 or higher
  • A current Interactive Data client account. If you do not yet have an account, click here to find out about setting up a trial.

To run the sample executable jar from a command line, go to the folder in which you unzipped the sample (see attachment below) and enter the following command:

> java -jar MarketDepthSample.jar [-h <host>] -u <username> -p <pwd> [-t <type> -x <source> -s <symbols>]
$ export LD_LIBRARY_PATH=./bin
$ java -jar MarketDepthSample.jar [-h <host>] -u <username> -p <pwd> [-t <type> -x <source> -s <symbols>]


-h <host> is the address to use to connect to the Interactive Data Consolidated Feed Network.
-u <username> is the username for your client (required field)
-p <pwd> is the password for your client (required field)
-t <depth type> is the depth type used to get the Level2 data
-x <source> is the depth source used to get the Level2 data
-s <symbols> The symbol, or symbols, to use for making the Market Depth request. A single instrument may be entered, or a comma separated list of symbols. Symbols that include a space must be enclosed in quotes. For example:

-s "CL #F"

Multiple symbols must be separated by commas with no spaces. If one of the symbols contains a space, the entire list must be enclosed in quotes. Here are two examples:


-s "IBM,CL #F,WFM"

Note: If you do not enter a value for <host>, <depth type>, <depth source>, or <symbols> the values listed in the file will be used.

<username> and <password> must be entered at the command line.