zenbot icon indicating copy to clipboard operation
zenbot copied to clipboard

Pre-load history?

Open alternativesurfer opened this issue 9 years ago • 1 comments

Is there anyway to add historical data, rather than sitting around for a few months collecting backfill data?

alternativesurfer avatar Jan 20 '17 20:01 alternativesurfer

Somebody else may answer with more applicable info, but in the meantime, here is something to start with.

Are you working with Gdax? I would need to take a look at how the --backfiill works, but I am assuming we could alster that to use the gdax api for historic rates which gives you [time, low, high, open, close, volume ] https://docs.gdax.com/#get-historic-rates

If you use the npm package from Gdax you can call: publicClient.getProductHistoricRates({'granularity': 3000}, callback);

I assume you can add {'start': startTime, 'end': endTime}. The start/end time needs to be ISO 8601, but keep in mind whatever granularity you choose you can only ask for 200 candles at a time. The granularity slice is in seconds. if you are doing a fine granularity you may need to repeat the call with the appropriate start/end times until you have the dataset you want. The thing is this seems to be the api call they like to throttle the most so you would still need to have time between each request. I see that carlos8f wrote a bucket package as well that may be useful here.

s-ftf avatar Jan 20 '17 23:01 s-ftf