Best way to get historical tick data

So I’m about to subscribe to the 1 year historical tick data add on but I had a few questions before I start.

So from the tutorials / this forum, it looks like the only way to get historical data is to grab it 4096 ticks at a time through the chart subscription.

  1. Is there an easier way to bulk load the tick data? I’m trying to do some analysis.

  2. If there is no other way, the method of setting the oldest tick timestamp to timeRange.closestTimestamp, is that inclusive, meaning will the next batch of ticks include the oldest tick from the previous batch?

  3. Is there any problem with continuously fetching previous ticks for up to a year? It seems like it would take a long time if we were to just go 4k ticks at a time.

It will take a long time. What you’ll want to do is determine your range, then start a subscription to market data within that range. Use the chart parameters asFarAsTimestamp to choose the furthest timestamp you want tick data for and the closestTimestamp field to tell the request where to start from. If this totals more than the max amount of tick data transmitted by one request, the request will end at the oldest timestamp it could load. You can replace your closestTimestamp with the timestamp on the oldest tick and start the request over again with those values. Repeat this process until the oldest timestamp is the same as your target timestamp, then you know you have the full set of data that you want to operate on.

Here’s an example of how to do this in JS with bars, you can adapt it to ticks fairly easily I’d imagine.