Added XRP_USDT-1h-mark json testdat file, and test for ohlcv_load with candle_type=mark

This commit is contained in:
Sam Germain 2021-11-19 03:55:52 -06:00
parent 043ed3e330
commit 91a11d01e9
2 changed files with 108 additions and 0 deletions

View File

@ -669,6 +669,12 @@ def test_jsondatahandler_ohlcv_load(testdatadir, caplog):
df = dh.ohlcv_load('XRP/ETH', '5m') df = dh.ohlcv_load('XRP/ETH', '5m')
assert len(df) == 711 assert len(df) == 711
df_mark = dh.ohlcv_load('XRP/USDT', '1h', candle_type="mark")
assert len(df_mark) == 99
df_no_mark = dh.ohlcv_load('XRP/USDT', '1h')
assert len(df_no_mark) == 0
# Failure case (empty array) # Failure case (empty array)
df1 = dh.ohlcv_load('NOPAIR/XXX', '4m') df1 = dh.ohlcv_load('NOPAIR/XXX', '4m')
assert len(df1) == 0 assert len(df1) == 0

102
tests/testdata/XRP_USDT-1h-mark.json vendored Normal file
View File

@ -0,0 +1,102 @@
[
[1636956000000, 1.20932, 1.21787, 1.20763, 1.21431, null],
[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.06051, null]
]