diff --git a/freqtrade/data/history/hdf5datahandler.py b/freqtrade/data/history/hdf5datahandler.py index 7d5b4f041..6a66118c4 100644 --- a/freqtrade/data/history/hdf5datahandler.py +++ b/freqtrade/data/history/hdf5datahandler.py @@ -54,7 +54,7 @@ class HDF5DataHandler(IDataHandler): candle_type = "" _tmp = [re.search(r'^(\S+)(?=\-' + timeframe + candle_type + '.h5)', p.name) - for p in datadir.glob(f"*{timeframe}.h5")] + for p in datadir.glob(f"*{timeframe}{candle_type}.h5")] # Check if regex found something and only return these results return [match[0].replace('_', '/') for match in _tmp if match] diff --git a/freqtrade/data/history/jsondatahandler.py b/freqtrade/data/history/jsondatahandler.py index fca80d35a..ddbc626bc 100644 --- a/freqtrade/data/history/jsondatahandler.py +++ b/freqtrade/data/history/jsondatahandler.py @@ -54,7 +54,7 @@ class JsonDataHandler(IDataHandler): candle_type = "" _tmp = [re.search(r'^(\S+)(?=\-' + timeframe + candle_type + '.json)', p.name) - for p in datadir.glob(f"*{timeframe}.{cls._get_file_extension()}")] + for p in datadir.glob(f"*{timeframe}{candle_type}.{cls._get_file_extension()}")] # Check if regex found something and only return these results return [match[0].replace('_', '/') for match in _tmp if match] diff --git a/tests/data/test_history.py b/tests/data/test_history.py index 0030797e8..a1448c92d 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -629,6 +629,16 @@ def test_datahandler_ohlcv_get_pairs(testdatadir): pairs = HDF5DataHandler.ohlcv_get_pairs(testdatadir, '5m') assert set(pairs) == {'UNITTEST/BTC'} + pairs = JsonDataHandler.ohlcv_get_pairs(testdatadir, '1h', 'mark') + assert set(pairs) == {'UNITTEST/USDT', 'XRP/USDT'} + + # TODO-lev: The tests below + # pairs = JsonGzDataHandler.ohlcv_get_pairs(testdatadir, '8m') + # assert set(pairs) == {'UNITTEST/BTC'} + + # pairs = HDF5DataHandler.ohlcv_get_pairs(testdatadir, '5m') + # assert set(pairs) == {'UNITTEST/BTC'} + def test_datahandler_ohlcv_get_available_data(testdatadir): paircombs = JsonDataHandler.ohlcv_get_available_data(testdatadir) diff --git a/tests/testdata/UNITTEST_USDT-1h-mark.json b/tests/testdata/UNITTEST_USDT-1h-mark.json new file mode 100644 index 000000000..312f616fb --- /dev/null +++ b/tests/testdata/UNITTEST_USDT-1h-mark.json @@ -0,0 +1,102 @@ +[ + [1636959600000, 1.21431, 1.2198, 1.20895, 1.20895, null], + [1636963200000, 1.20902, 1.21106, 1.19972, 1.20968, null], + [1636966800000, 1.20968, 1.21876, 1.20791, 1.20998, null], + [1636970400000, 1.20999, 1.21043, 1.20442, 1.20859, null], + [1636974000000, 1.20858, 1.20933, 1.20154, 1.20581, null], + [1636977600000, 1.20584, 1.20775, 1.20065, 1.20337, null], + [1636981200000, 1.20342, 1.2097, 1.19327, 1.19792, null], + [1636984800000, 1.19796, 1.1982, 1.18611, 1.19024, null], + [1636988400000, 1.19025, 1.19177, 1.18373, 1.18771, null], + [1636992000000, 1.18768, 1.19109, 1.18095, 1.1887, null], + [1636995600000, 1.18869, 1.18968, 1.18355, 1.18387, null], + [1636999200000, 1.18388, 1.18729, 1.17753, 1.18138, null], + [1637002800000, 1.18145, 1.18684, 1.17799, 1.18463, null], + [1637006400000, 1.18464, 1.18474, 1.17368, 1.17652, null], + [1637010000000, 1.17653, 1.18185, 1.16557, 1.17979, null], + [1637013600000, 1.17979, 1.18113, 1.16934, 1.18014, null], + [1637017200000, 1.18014, 1.18015, 1.16999, 1.17214, null], + [1637020800000, 1.17214, 1.17217, 1.12958, 1.14209, null], + [1637024400000, 1.14255, 1.14666, 1.10933, 1.14198, null], + [1637028000000, 1.14197, 1.14419, 1.12766, 1.12999, null], + [1637031600000, 1.12999, 1.13522, 1.11142, 1.12177, null], + [1637035200000, 1.12176, 1.13211, 1.10579, 1.1288, null], + [1637038800000, 1.12871, 1.13243, 1.12142, 1.12316, null], + [1637042400000, 1.12323, 1.1262, 1.11489, 1.12429, null], + [1637046000000, 1.12406, 1.12727, 1.11835, 1.1249, null], + [1637049600000, 1.12485, 1.13047, 1.1211, 1.12931, null], + [1637053200000, 1.12931, 1.13346, 1.10256, 1.10267, null], + [1637056800000, 1.10266, 1.10412, 1.04149, 1.0928, null], + [1637060400000, 1.09277, 1.09856, 1.08371, 1.09093, null], + [1637064000000, 1.09094, 1.09512, 1.079, 1.08003, null], + [1637067600000, 1.0802, 1.09914, 1.08016, 1.09515, null], + [1637071200000, 1.09518, 1.11627, 1.0937, 1.10985, null], + [1637074800000, 1.10985, 1.11353, 1.09618, 1.10071, null], + [1637078400000, 1.09989, 1.10852, 1.09763, 1.10461, null], + [1637082000000, 1.10459, 1.10837, 1.09662, 1.09847, null], + [1637085600000, 1.09858, 1.10506, 1.08687, 1.08716, null], + [1637089200000, 1.08677, 1.10096, 1.08151, 1.09271, null], + [1637092800000, 1.09245, 1.09269, 1.06592, 1.08025, null], + [1637096400000, 1.08026, 1.09732, 1.07953, 1.09527, null], + [1637100000000, 1.09527, 1.10506, 1.09524, 1.09933, null], + [1637103600000, 1.09933, 1.10205, 1.08761, 1.08785, null], + [1637107200000, 1.08763, 1.09518, 1.07646, 1.07999, null], + [1637110800000, 1.07997, 1.0978, 1.07651, 1.07936, null], + [1637114400000, 1.07932, 1.08758, 1.07352, 1.07603, null], + [1637118000000, 1.07604, 1.08542, 1.05931, 1.06764, null], + [1637121600000, 1.06788, 1.07848, 1.06045, 1.07608, null], + [1637125200000, 1.07613, 1.08797, 1.07293, 1.08377, null], + [1637128800000, 1.08379, 1.08567, 1.07428, 1.07942, null], + [1637132400000, 1.07958, 1.09472, 1.07356, 1.08713, null], + [1637136000000, 1.08714, 1.09149, 1.08018, 1.08021, null], + [1637139600000, 1.08021, 1.08021, 1.0668, 1.07032, null], + [1637143200000, 1.07042, 1.10563, 1.07034, 1.10255, null], + [1637146800000, 1.10284, 1.10954, 1.09767, 1.10685, null], + [1637150400000, 1.10669, 1.10848, 1.10157, 1.10537, null], + [1637154000000, 1.10537, 1.11263, 1.09554, 1.09585, null], + [1637157600000, 1.09569, 1.10051, 1.08402, 1.08431, null], + [1637161200000, 1.08444, 1.08942, 1.07569, 1.08489, null], + [1637164800000, 1.08498, 1.09581, 1.07939, 1.09485, null], + [1637168400000, 1.09443, 1.09793, 1.08778, 1.0944, null], + [1637172000000, 1.09445, 1.10227, 1.09376, 1.0992, null], + [1637175600000, 1.0992, 1.10189, 1.09216, 1.09474, null], + [1637179200000, 1.09476, 1.10198, 1.09045, 1.0993, null], + [1637182800000, 1.09934, 1.09959, 1.08755, 1.0948, null], + [1637186400000, 1.09483, 1.09519, 1.08532, 1.0923, null], + [1637190000000, 1.0923, 1.09876, 1.0874, 1.095, null], + [1637193600000, 1.09503, 1.10673, 1.09047, 1.10441, null], + [1637197200000, 1.10437, 1.16166, 1.09815, 1.12902, null], + [1637200800000, 1.12875, 1.15094, 1.1242, 1.13764, null], + [1637204400000, 1.13795, 1.14262, 1.12341, 1.12423, null], + [1637208000000, 1.12424, 1.14806, 1.11333, 1.1142, null], + [1637211600000, 1.11435, 1.12608, 1.11085, 1.11436, null], + [1637215200000, 1.11398, 1.11718, 1.10538, 1.11388, null], + [1637218800000, 1.1139, 1.11452, 1.09674, 1.1072, null], + [1637222400000, 1.10725, 1.10999, 1.10209, 1.10706, null], + [1637226000000, 1.10712, 1.10712, 1.07747, 1.08658, null], + [1637229600000, 1.08692, 1.09865, 1.0807, 1.09767, null], + [1637233200000, 1.09768, 1.10211, 1.08348, 1.08409, null], + [1637236800000, 1.08423, 1.09498, 1.08002, 1.08259, null], + [1637240400000, 1.0827, 1.08773, 1.06597, 1.07719, null], + [1637244000000, 1.07718, 1.08075, 1.06678, 1.07077, null], + [1637247600000, 1.07029, 1.07824, 1.04568, 1.05497, null], + [1637251200000, 1.05591, 1.06325, 1.03957, 1.04032, null], + [1637254800000, 1.04051, 1.05342, 1.01557, 1.04158, null], + [1637258400000, 1.04153, 1.05436, 1.04122, 1.05208, null], + [1637262000000, 1.05207, 1.05948, 1.04961, 1.05515, null], + [1637265600000, 1.05516, 1.05927, 1.04767, 1.04808, null], + [1637269200000, 1.04789, 1.05622, 1.04191, 1.04587, null], + [1637272800000, 1.04575, 1.05336, 1.03405, 1.03941, null], + [1637276400000, 1.03931, 1.04614, 1.02868, 1.0411, null], + [1637280000000, 1.04093, 1.05672, 1.0295, 1.05495, null], + [1637283600000, 1.05495, 1.0553, 1.03548, 1.03595, null], + [1637287200000, 1.0359, 1.04585, 1.02026, 1.02312, null], + [1637290800000, 1.0242, 1.02908, 1.01788, 1.02871, null], + [1637294400000, 1.02871, 1.04474, 1.02584, 1.04247, null], + [1637298000000, 1.04251, 1.04654, 1.03685, 1.0449, null], + [1637301600000, 1.0449, 1.04971, 1.04109, 1.04452, null], + [1637305200000, 1.04456, 1.04875, 1.03802, 1.04268, null], + [1637308800000, 1.04239, 1.06573, 1.04164, 1.05717, null], + [1637312400000, 1.05721, 1.06464, 1.05619, 1.05896, null], + [1637316000000, 1.05893, 1.05918, 1.04976, 1.05188, null] +]