This executable sample demonstrates methods for requesting and processing snapshot or streaming Level 1 data. There is a link to download the sample at the end of this article.
Before you run the sample, you need to have the following:
- Java Runtime Environment (JRE) 1.8 or higher
- A current ICE Data Services 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:
Windows
> java -cp .;JStandardSamples.jar;lib/* QuoteManager.Level1QuoteRequest.Main
[-h <host>] -u <username> -p <password> [-m <mode> -s <symbol>]
Linux
$ java -cp .:JStandardSamples.jar:lib/* QuoteManager.Level1QuoteRequest.Main
[-h <host>] -u <username> -p <password> [-m <mode> -s <symbol>]
where:
Argument | Value | Description |
---|---|---|
-h | <host> | is the address to use to connect to the ICE Data Services 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> | Indicates if the request is for snapshot or streaming data. Acceptable values include: snapshot or subscribe |
-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: |
Note: <username>
and <password>
must be entered at the command line, but the other arguments are optional. If you do not provide a value for an argument the sample will use a default value.