diff --git a/freqtrade/data/history/hdf5datahandler.py b/freqtrade/data/history/hdf5datahandler.py index debbcce8b..6a4f45fa9 100644 --- a/freqtrade/data/history/hdf5datahandler.py +++ b/freqtrade/data/history/hdf5datahandler.py @@ -139,7 +139,8 @@ class HDF5DataHandler(IDataHandler): column sequence as in DEFAULT_TRADES_COLUMNS """ key = self._pair_trades_key(pair) - ds = pd.HDFStore(self.filename_trades, mode='a', complevel=9, complib='blosc') + ds = pd.HDFStore(self._pair_trades_filename(self._datadir, pair), + mode='a', complevel=9, complib='blosc') ds.put(key, pd.DataFrame(data, columns=DEFAULT_TRADES_COLUMNS), format='table', data_columns=['timestamp']) ds.close() diff --git a/tests/data/test_history.py b/tests/data/test_history.py index 2c0665b69..003e90fbb 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -707,6 +707,12 @@ def test_datahandler_trades_append(datahandler, testdatadir): dh.trades_append('UNITTEST/ETH', []) +def test_hdf5datahandler_trades_get_pairs(testdatadir): + pairs = HDF5DataHandler.trades_get_pairs(testdatadir) + # Convert to set to avoid failures due to sorting + assert set(pairs) == {'XRP/ETH'} + + def test_gethandlerclass(): cl = get_datahandlerclass('json') assert cl == JsonDataHandler diff --git a/tests/testdata/UNITTEST_BTC-5m.h5 b/tests/testdata/UNITTEST_BTC-5m.h5 new file mode 100644 index 000000000..52232af9e Binary files /dev/null and b/tests/testdata/UNITTEST_BTC-5m.h5 differ diff --git a/tests/testdata/XRP_ETH-trades.h5 b/tests/testdata/XRP_ETH-trades.h5 new file mode 100644 index 000000000..c13789e2a Binary files /dev/null and b/tests/testdata/XRP_ETH-trades.h5 differ