From 53ee636fa02880d12ef3c32430e62d1af3f7a92f Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 25 Dec 2019 15:24:53 +0100 Subject: [PATCH] Check if file exists before loading --- freqtrade/data/datahandlers/jsondatahandler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/freqtrade/data/datahandlers/jsondatahandler.py b/freqtrade/data/datahandlers/jsondatahandler.py index 215aa003a..2893393b1 100644 --- a/freqtrade/data/datahandlers/jsondatahandler.py +++ b/freqtrade/data/datahandlers/jsondatahandler.py @@ -66,6 +66,8 @@ class JsonDataHandler(IDataHandler): :return: DataFrame with ohlcv data, or empty DataFrame """ filename = self._pair_data_filename(self._datadir, pair, timeframe) + if not filename.is_file(): + return DataFrame(columns=self._columns) pairdata = read_json(filename, orient='values') pairdata.columns = self._columns pairdata['date'] = to_datetime(pairdata['date'],