get_ticker_history: check if result is set (fixes #103)
This commit is contained in:
parent
b83309b55d
commit
b5f58724a0
@ -101,7 +101,11 @@ class Bittrex(Exchange):
|
|||||||
raise ValueError('Cannot parse tick_interval: {}'.format(tick_interval))
|
raise ValueError('Cannot parse tick_interval: {}'.format(tick_interval))
|
||||||
|
|
||||||
data = _API_V2.get_candles(pair.replace('_', '-'), interval)
|
data = _API_V2.get_candles(pair.replace('_', '-'), interval)
|
||||||
# This sanity check is necessary because bittrex returns nonsense sometimes
|
|
||||||
|
# These sanity check are necessary because bittrex cannot keep their API stable.
|
||||||
|
if not data.get('result'):
|
||||||
|
return []
|
||||||
|
|
||||||
for prop in ['C', 'V', 'O', 'H', 'L', 'T']:
|
for prop in ['C', 'V', 'O', 'H', 'L', 'T']:
|
||||||
for tick in data['result']:
|
for tick in data['result']:
|
||||||
if prop not in tick.keys():
|
if prop not in tick.keys():
|
||||||
|
Loading…
Reference in New Issue
Block a user