mirror of
https://github.com/wassname/libcryptomarket.git
synced 2026-09-17 12:20:11 +08:00
Ensure start time does not roll back in candles
This commit is contained in:
@@ -73,10 +73,13 @@ def candles(source, symbol, start_time, end_time, frequency, **kwargs):
|
||||
data["start_time"].iloc[0] >= last_start_time):
|
||||
break
|
||||
|
||||
start_time = data["end_time"].iloc[-1]
|
||||
|
||||
all_data.append(data)
|
||||
|
||||
if data["end_time"].iloc[-1] > start_time:
|
||||
start_time = data["end_time"].iloc[-1]
|
||||
else:
|
||||
break
|
||||
|
||||
if len(all_data) == 0:
|
||||
raise ValueError("Start time cannot be after end time.")
|
||||
elif len(all_data) == 1:
|
||||
|
||||
Reference in New Issue
Block a user