Request Reference
Subscribe Quote
Endpoint: md/subscribeQuote
Parameters:
Data message
Unsubscribe Quote
Endpoint: md/unsubscribeQuote
Parameters:
Subscribe DOM
Endpoint: md/subscribeDOM
Parameters:
Data message
Unsubscribe DOM
Endpoint: md/unsubscribeDOM
Parameters:
Subscribe Histogram
Endpoint: md/subscribeHistogram
Parameters:
Data message
Unsubscribe Histogram
Endpoint: md/unsubscribeHistogram
Parameters:
Get Chart
A client application may have multiple charts for the same contract, so the response for a 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:
Parameter Notes
underlyingType: the bar type.MinuteBaris time-based (the most common),DailyBaris daily OHLCV,Tickis tick-based,Customcovers Renko, range, and similar bars, andDOMis depth-of-market snapshots (rarely used for charting).elementSize: the size of each bar. Its meaning depends onelementSizeUnit. For example,5underMinuteBarandUnderlyingUnitsis a 5-minute bar, and100underTickis a 100-tick bar.elementSizeUnit:UnderlyingUnitsis the native unit of theunderlyingType(minutes forMinuteBar, days forDailyBar, ticks forTick).MinuteBarandDailyBarmust useUnderlyingUnits.Secondsforces time-based sizing in seconds and is used withTickfor sub-minute bars, such as a 15-second bar. A tick chart isTickwithelementSize1 andUnderlyingUnits.withHistogram: whentrue, the response includes volume-at-price histogram data. For histograms it is best to subscribe separately viamd/subscribeHistogram.
Response
A md/getChart response returns a subscription ID in both the historicalId and realtimeId fields. To cancel the chart, pass either one to md/cancelChart. Store the ID if you may need to cancel it. The mode field reports whether the feed is RealTime or Delayed.
Data message
Data Size Limits
The data-size limit per md/getChart request is flexible rather than a fixed hard cap, and it can vary from day to day. In practice, MinuteBar and Tick requests tend to return at most about two months of data per request. Historical depth differs by bar type: MinuteBar data generally goes back to January 1, 2017 for most continuous contracts, while raw tick history generally covers only about the last two months. For more on accessing historical data, see this community thread.
To load more history than a single request returns, paginate backward through the data. For the backfill loop and the timeRange strategies that control how much history you load, see Charting Best Practices.
Cancel Chart
Endpoint: md/cancelChart