rosspalmer / bitQuant

Bitcoin data gathering, backtesting, and algorithmic trading solution
MIT License
23 stars 9 forks source link

Adding Coinbase exchange support #4

Closed multidis closed 9 years ago

multidis commented 9 years ago

Coinbase exchange has been gaining trade volume and by now frequently exceeds bitstamp volume. Some difficulties when adding it to api.py:

Would be great to have the former solved by allowing an alternative column name to be specified for "amount" to accommodate the Conbase API. As far as the latter, it is not a problem if querying frequently but with less frequent calls may be an issue (trading peaks at over 100 trades/min at times).

rosspalmer commented 9 years ago

I definitely agree that Coinbase needs to be supported, I want this to be a one stop shop for all major exchanges. For some reasons I had it in my mind that authentication was needed for Coinbase trade data requests but based on the response link, that's not the case.

This will actually be easy to implement as I had to deal with the same problem with Chinese exchanges using date instead of timestamp. The tools.standard_columns function uses a dictionary to set "standard" column names and then drops any column names not contained in the dictionary so I just need size to dictionary.

The pagination issue will also need to be addressed so that Coinbase data functions the same as the other exchanges.

I will take a look at this tonight as well as add support for the exchanges below:

rosspalmer commented 9 years ago

I've added support for Coinbase exchange. There is a limitation of only 100 trades per ping but the since_history uses the after= parameter to build a complete trade history by working its way backwards 100 at a time to a certain date.

Not a perfect solution but gives you the ability to build a reliable Coinbase trade/price history.

I will post a tutorial on the since_history function soon.

rosspalmer commented 9 years ago

This wiki page has a since_history tutorial.

multidis commented 9 years ago

Coinbase supported, great! Exchanges limit their API access frequency to around 1 request per sec. I wonder if querying coinbase trade history page-by-page may exceed this limit for large queries and get the IP banned? Perhaps a limitation on the API call frequency would be good for paginated requests?

multidis commented 9 years ago

Also a minor note: tutorial url-links to wiki pages in README are not working.

rosspalmer commented 9 years ago

I'm going to work on the class a bit to be a little bit smarter in its scans and will absolutely put frequency limiter into it. Would be bad get people in to trouble with their exchanges.