goxtool
goxtool copied to clipboard
Support for arbitrary number of days of back history
This implements an ability to tell the client how many back days of trading history to get at startup. In addition, this should deal with long periods of connection failure by pulling trades sequentially up until the current time.
I mainly wanted to see if you'd be interested in this type of patch, which would be useful for those who want more history in their strategies.
Additional considerations:
- Takes a while to download trades, probably should have some way of caching them (maybe cpickle).
- For RAM considerations, one might want to consider garbage collecting candles over a certain age for long-running instances, but this could be a separate patch.
James, I implemented this patch a few months ago and it has been a brilliant addition to my setup. Basically, I store all tick data and depth messages to a local DB for analysis and mining, so your code and its functionality gave me a basis from which to meaningfully collect, partition and store data. By now my code allows the API to collect historic data from a cache, but the cache building and updates are all happening via this patch. Thanks a lot!
Glad to hear it! I was planning on doing something similar, but haven't gotten around to it.
Another thing it might be nice to collect logs of would be the book states going back through history to be used for backtesting.