stable/freqtrade
creslinux 1e707ea9c9 handle index out of range error
trim_tickerlist is called from load_datafile.
trim_tickerlist will throw an index out of range error when parsing a ticker json file for a timerange outside its current contents.
This patch to load_datafile checks the timerange is in the file or not handles the exception by downloading the file with complete range. If the Exchange does not have the full range a message is logged and the file not sent to ticker-parse.

In summary, is json file does not have full requested time range
1. download file
2. if still missing time range, log and continue without ticker trim.

Here is an example of the error prior to path and after patching.
This is from binannce using the pair "ZEN/BTC" and timerange "20180522-20180523"
"""
  File "/Users/creslin/PycharmProjects/freqtrade/freqtrade/optimize/__init__.py", line 107, in load_data
    pairdata = load_tickerdata_file(datadir, pair, ticker_interval, timerange=timerange)
  File "/Users/creslin/PycharmProjects/freqtrade/freqtrade/optimize/__init__.py", line 84, in load_tickerdata_file
    pairdata = trim_tickerlist(pairdata, timerange)
  File "/Users/creslin/PycharmProjects/freqtrade/freqtrade/optimize/__init__.py", line 36, in trim_tickerlist
while tickerlist[start_index][0] < start * 1000:
IndexError: list index out of range
""""

"""
2018-05-31 14:08:04,680 - freqtrade.optimize - INFO - Start timerange not in cached data
2018-05-31 14:08:04,680 - freqtrade.optimize - INFO - Download the pair: "ZEN/BTC", Interval: 5m
dumping json to "/Users/creslin/PycharmProjects/freqtrade/freqtrade/tests/testdata/ZEN_BTC-5m.json"
2018-05-31 14:08:08,225 - freqtrade.optimize - INFO - Start timerange unavailable from exchange
"""
2018-05-31 19:02:02 +03:00
..
exchange Reduce verbosity of get_ticker_history 2018-05-12 20:15:59 +02:00
optimize handle index out of range error 2018-05-31 19:02:02 +03:00
rpc Make telegram message beautiful 2018-05-15 13:37:34 +03:00
strategy Merge branch 'develop' into feat/objectify-ccxt 2018-05-02 22:49:55 +02:00
tests Merge pull request #734 from arudov/fix/pair-downloads 2018-05-29 08:05:10 +03:00
vendor add missing import 2017-11-20 22:26:32 +01:00
__init__.py Freqtrade: ccxt release shall be called 0.17.0 2018-05-12 09:57:10 +03:00
analyze.py Merge branch 'develop' into feat/objectify-ccxt 2018-05-02 22:49:55 +02:00
arguments.py Make plot_dataframe able to show trades stored in database. (#692) 2018-05-19 09:14:42 +03:00
configuration.py Merge branch 'develop' into feat/objectify-ccxt 2018-05-02 22:49:55 +02:00
constants.py fix 'max_open_trades must be greater than 0' regression 2018-05-03 10:48:25 +02:00
fiat_convert.py Fix error initializing coinmarketcap 2018-05-21 20:01:41 +02:00
freqtradebot.py Fix bug pointed out in #679 2018-05-15 19:49:28 +02:00
indicator_helpers.py indicator_helpers: apply correct typehints 2018-03-20 19:48:03 +01:00
main.py set ccxt loglevel to info 2018-05-25 21:23:15 +02:00
misc.py exchange: extract ccxt init to its own function (so that we can init ccxt from the scripts) 2018-04-22 10:57:48 +03:00
persistence.py Convert exchange-name to new format 2018-05-12 13:39:16 +02:00
state.py Add a Enum class State that contains Bot running states 2018-03-03 09:33:54 +08:00