Accessing historical data & histogram

Okay, as a basic example, I’m sending the follow message to access “@NQ” data (continuous):

            symbol: "@NQ",
            chartDescription: {
              withHistogram: true,
              elementSize: 5,
              elementSizeUnit: "UnderlyingUnits",
              underlyingType: "MinuteBar",
            },
            timeRange: {
              asMuchAsElements: 300,
              //closestTimestamp: "2021-04-04T19:45:00.000Z", // Enable this to use historical
            },

This allows me to access 5m bars on the “@NQ” with histograms intact. To go back further, I enable

closestTimestamp

and I am able to go back ~2 months, BUT, if I keep the following enabled

withHistogram: true

It just returns, which I presume means no data:

a[{“s”:200,“i”:2,“d”:{“mode”:“RealTime”,“historicalId”:743368,“realtimeId”:743368}}]
a[{“e”:“chart”,“d”:{“charts”:[{“id”:743368,“eoh”:true}]}}]

When I disable the histogram, I am able to access 5m bars back 2 months. When I then try to go back 3 or 4 months by adjusting closestTimestamp, it doesn’t seem to work.

I think I’ve read the “@NQ” goes back to 2017, but is there some other way I should be accessing this historical market data (5m bars) as well as associated histograms?

Thanks for your help and I appreciate your clarification! Great API nonetheless

You can get more historical data by changing underlyingType from "MinuteBar" to "DailyBar". You can only get about 2 months of data using minute bars but you can get a great deal of historical data (back to 2015 using @NQ) if you look at "DailyBar". Try using this data for your chart:

{
    "symbol": "@NQ",
    "chartDescription": {
        "underlyingType": "DailyBar",
        "elementSize": 1,
        "elementSizeUnit": 'UnderlyingUnits',
    },
    "timeRange": {
        "closestTimestamp": "2021-06-10T19:45:00.000Z",
        "asFarAsTimeStamp": "2017-12-01T19:45:00.000Z"
    }            
}

i assume theres no available tick-by-tick data, right? I know that’s definitely a long shot but figured I’d ask. thanks!

You can request tick data as well using a websocket for market data. Check this part of the API docs out:
https://api.tradovate.com/#section/Request-Reference/Cancel-Chart

1 Like

@Alexander

I’m able to access live tick data, but is there a way to access historical? I vaguely remember reading somewhere we should be able to access 1 year of tick data?

Otherwise I need to record the data for a while before I can use this model I’m building.

Hello @Boomerang,

You can get up to 1 year of historical tick data if you have the Extended Data addon (currently $9.95/month). With no extended data subscription, you’ll get about two months of historical tick data.