rosspalmer / bitQuant

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

Coinbase error for limit over 100 #10

Open multidis opened 9 years ago

multidis commented 9 years ago

This works fine:

ping = bq.request('coinbase', 'btcusd', limit=100)
ping.get()

But when limit is set over 100, an exception is raised:

Traceback (most recent call last): File "", line 1, in File "bitquant/api.py", line 28, in get df = self.df_trades(response) File "bitquant/api.py", line 128, in df_trades df['time'] = to_datetime(df['time'], utc=0) ... KeyError: 'time'

Probably has to do with the pagination setup of coinbase API.

Keeping Coinbase limit to 100 is a reasonable idea (one "page" of their results?), yet it is preferable not to have the error above.

rosspalmer commented 9 years ago

Coinbase continues to be interesting, normally if you exceed the limit the default size is returned, Coinbase returns an error.

I need to look up all the individual maxs but a limiter is going to be best. Could easily be added to the api dictionary.