Request Reference

Subscribe Quote

Endpoint: md/subscribeQuote

Parameters:

1{ "symbol": "ESM7" | 123456 }

Data message

1{
2 "e":"md",
3 "d": {
4 "quotes": [ // "quotes" may contain multiple quote objects
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}

Unsubscribe Quote

Endpoint: md/unsubscribeQuote

Parameters:

1{ "symbol": "ESM7" | 123456 }

Subscribe DOM

Endpoint: md/subscribeDOM

Parameters:

{ "symbol": "ESM7" | 123456 }

Data message

1{
2 "e":"md",
3 "d": {
4 "doms": [ // "doms" may contain multiple DOM objects
5 {
6 "contractId":123456, // ID of the DOM contract
7 "timestamp":"2021-04-13T11:33:57.488Z",
8 "bids": [ // Actual depth of "bids" may varies depending on available data
9 {"price":2335.25,"size":33.54},
10 ...
11 {"price":2333,"size":758.21}
12 ],
13 "offers": [ // Actual depth of "offers" may varies depending on available data
14 {"price":2335.5,"size":255.12},
15 ...
16 {"price":2337.75,"size":466.64}
17 ]
18 }
19 ]
20 }
21}

Unsubscribe DOM

Endpoint: md/unsubscribeDOM

Parameters:

1{ "symbol": "ESM7" | 123456 }

Subscribe Histogram

Endpoint: md/subscribeHistogram

Parameters:

1{ "symbol": "ESM7" | 123456 }

Data message

1{
2 "e":"md",
3 "d": {
4 "histograms": [ // "histograms" may contain multiple histogram objects
5 {
6 "contractId":123456, // ID of the histogram contract
7 "timestamp":"2017-04-13T11:33:57.412Z",
8 "tradeDate": {
9 "year":2022,
10 "month":4,
11 "day":13
12 },
13 "base":2338.75,
14 "items": { // Actual number of histogram items may depend on data
15 "-14":5906.67,
16 ...
17 "2":1234.55,
18 },
19 "refresh":false
20 }
21 ]
22 }
23}

Unsubscribe Histogram

Endpoint: md/unsubscribeHistogram

Parameters:

1{ "symbol": "ESM7" | 123456 }

Get Chart

A client application may have multiple charts for the same contract, so the response for md/getChart request contains a subscription ID to properly track and unsubscribe from a real-time chart subscription. If you’re using JavaScript, don’t forget to check the section on charts in our API’s comprehensive JavaScript tutorial.

Endpoint: md/getChart

Parameters:

1{
2 "symbol":"ESM7" | 123456,
3 "chartDescription": {
4 "underlyingType":"MinuteBar", // Available values: Tick, DailyBar, MinuteBar, Custom, DOM
5 "elementSize":15,
6 "elementSizeUnit":"UnderlyingUnits", // Available values: Volume, Range, UnderlyingUnits, Renko, MomentumRange, PointAndFigure, OFARange
7 "withHistogram": true | false
8 },
9 "timeRange": {
10 // All fields in "timeRange" are optional, but at least anyone is required
11 "closestTimestamp":"2017-04-13T11:33Z",
12 "closestTickId":123,
13 "asFarAsTimestamp":"2017-04-13T11:33Z",
14 "asMuchAsElements":66
15 },
16}

Response

A response for md/getChart request contains two subscription ID, historicalId and realtimeId. Client needs to store realtimeId value to properly cancel real-time chart subscription via md/cancelChart request.

1{
2 "s":200,
3 "i":13,
4 "d":{
5 "historicalId":32,
6 "realtimeId":31
7 }
8}

Data message

1{
2 "e":"chart",
3 "d": {
4 "charts": [ // "charts" may contain multiple chart objects
5 {
6 "id":9, // "id" matches either historicalId or realtimeId values from response
7 "td":20170413, // Trade date as a number with value YYYYMMDD
8 "bars": [ // "bars" may contain multiple bar objects
9 {
10 "timestamp":"2017-04-13T11:00:00.000Z",
11 "open":2334.25,
12 "high":2334.5,
13 "low":2333,
14 "close":2333.75,
15 "upVolume":4712.234,
16 "downVolume":201.124,
17 "upTicks":1333.567,
18 "downTicks":82.890,
19 "bidVolume":2857.123,
20 "offerVolume":2056.224
21 }
22 ]
23 }
24 ]
25 }
26}

Cancel Chart

Endpoint: md/cancelChart

Parameters:

1{
2 "subscriptionId": 123456 // The value of historical chart subscription ID from `md/getChart` response
3}