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.
Before you run this sample, you need to have 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 from a command line, go to the folder in which you unzipped the sample (see attachment below) and enter the following command:
Windows
> MarketDepthSample.exe [-h <host>] -u <username> -p <password> [-m <mode> -t <type> -x <source> -f <filter>
-s <symbols> -csv <nodisp>]
Linux
$ export LD_LIBRARY_PATH=./ $ chmod a+x MarketDepthSample $ ./MarketDepthSample [-h <host>] -u <username> -p <password> [-m <mode> -t <type> -x <source> -f <filter>
-s <symbols> -csv <nodisp>]
where:
Argument | Value | Description |
---|---|---|
-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 | <password> | is the password for your client (required field) |
-m | <mode> | Specifies the type of request to submit to the Level 2 service. The following requests types are supported:
|
-t | <type> | Specifies the type of depth to provide. Available depth types include:
You may enter either the number or full description for the depth type. Here are two examples:
NOTE: If you enter the full description you must encapsulate it with quotes. |
-x | <source> | Specifies the venue from which to retrieve Level 2 data. Refer to the following article for a list of available sources: Available Depth Sources For example:
NOTE: The above example sets the depth source to NASDAQ. |
-f | <filter> | Instructs the Level 2 data service to provide filtered data. The following filters are supported:
You may enter either the number or full description for the depth filter. Here are two examples:
NOTE: If you enter the full description you must encapsulate it with quotes. |
-s | <symbols> | is a comma separated list of symbols for which to make a history request. Multiple symbols must be enclosed in quotes with no spaces between symbols. For example: IBM,GE,WFM |
-csv | <nodisp> | When this option is set the application will format the output to be suitable for a comma-separated value (CSV) file. When this option is not set, the application will format the output for display within the console window. To use this option you must also provide output file instructions. For example:
When you provide output instructions, no information will display on the console window. All output will be written to the file you specify. |
Note: If you do not enter a value for <host>, <type>, <source>, <filter>, or <symbols> the sample will user default values.
<username> and <password> must be entered at the command line.