This commit is contained in:
hroff-1902 2020-02-22 19:46:40 +03:00
parent 430f53ca11
commit c651e0ac82

View File

@ -69,10 +69,11 @@ class JsonDataHandler(IDataHandler):
filename = self._pair_data_filename(self._datadir, pair, timeframe) filename = self._pair_data_filename(self._datadir, pair, timeframe)
if not filename.exists(): if not filename.exists():
return DataFrame(columns=self._columns) return DataFrame(columns=self._columns)
pairdata = read_json(filename, orient='values', pairdata = read_json(filename, orient='values')
pairdata.columns = self._columns
pairdata = pairdata.astype(copy=False,
dtype={'open': 'float', 'high': 'float', dtype={'open': 'float', 'high': 'float',
'low': 'float', 'close': 'float', 'volume': 'float'}) 'low': 'float', 'close': 'float', 'volume': 'float'})
pairdata.columns = self._columns
pairdata['date'] = to_datetime(pairdata['date'], pairdata['date'] = to_datetime(pairdata['date'],
unit='ms', unit='ms',
utc=True, utc=True,