Market Data

Accessing Market Data

The Tradovate Market Data API provides a way to access market data such as quotes, DOM, charts and histograms. The API uses JSON format for request bodies and response data. The exchange of requests and responses are transmitted via the Tradovate WebSocket protocol.

In a typical scenario using the Market Data API consists of the following steps:

1. Acquire An Access Token Using Credentials

Partner application uses the standard Access procedure to acquire an Access Token.

2. Open a WebSocket and Get Authorized

Partner application opens a WebSocket connection and sends their access token using the authorization procedure noted in the WebSockets section.

3. Build a Request

Request parameters are an object in JSON format. Each request for real-time data requires a symbol parameter that specifies the contract for which market data is requested. Contract can be specified either by the contract symbol string or by the contract ID integer:

1{
2 "symbol":"ESM7" // Contract is specified by contract symbol
3 ...
4}
5// or
6{
7 "symbol":123456 // Contract is specified by contract ID
8 ...
9}

Requests may have additional parameters, which are described in the corresponding sections.

4. Subscribe to Real-Time Data

If a response is successful, the corresponding subscription is activated. The application will begin to receive market data. In order to properly unsubscribe from market data, the partner is responsible for keeping track of the contracts for which subscriptions are activated. A client can have a single subscription of each type (quotes, DOM, or charts) per contract.

Handling Market Data

Market data arrives from the Tradovate server to the client asynchronously as event messages of md or chart types, for example:

1{
2 "e":"md",
3 "d": {
4 "quotes": [
5 {
6 "timestamp":"2021-04-13T04:59:06.588Z",
7 "contractId":123456,
8 "entries": {
9 "Bid": { "price":18405.123, "size":7.123 },
10 "TotalTradeVolume": { "size":4118.123 },
11 "Offer": { "price":18410.012, "size":12.35 },
12 "LowPrice": { "price":18355.23 },
13 "Trade": { "price":18405.023, "size":2.10 },
14 "OpenInterest": { "size":40702.024 },
15 "OpeningPrice": { "price":18515.123 },
16 "HighPrice": { "price":18520.125 },
17 "SettlementPrice": { "price":18520.257 }
18 }
19 }
20 ]
21 }
22}

Unsubscribing From Market Data

Mirroring the process for market data subscription, the client creates request parameters, specifies request endpoint such as md/unsubscribeQuote and sends the request to the Tradovate server. If the request is successful, the server will deactivate your subscription and the client will stop receiving real-time data.