From b5f58724a0e7e660df49736ccd2e69b3d8cf7be8 Mon Sep 17 00:00:00 2001 From: gcarq Date: Wed, 15 Nov 2017 23:16:54 +0100 Subject: [PATCH] get_ticker_history: check if result is set (fixes #103) --- freqtrade/exchange/bittrex.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/bittrex.py b/freqtrade/exchange/bittrex.py index 2a9738cda..718500753 100644 --- a/freqtrade/exchange/bittrex.py +++ b/freqtrade/exchange/bittrex.py @@ -101,7 +101,11 @@ class Bittrex(Exchange): raise ValueError('Cannot parse tick_interval: {}'.format(tick_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 tick in data['result']: if prop not in tick.keys():