mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Improve trades-cached handling
This commit is contained in:
parent
c891e38f2b
commit
6b99033164
|
@ -2703,7 +2703,11 @@ class Exchange:
|
|||
)
|
||||
|
||||
if not all_stored_ticks_df.empty:
|
||||
if all_stored_ticks_df.iloc[0]["timestamp"] <= first_candle_ms:
|
||||
if (
|
||||
all_stored_ticks_df.iloc[-1]["timestamp"] > first_candle_ms
|
||||
and all_stored_ticks_df.iloc[0]["timestamp"] <= first_candle_ms
|
||||
):
|
||||
# Use cache and populate further
|
||||
last_cached_ms = all_stored_ticks_df.iloc[-1]["timestamp"]
|
||||
from_id = all_stored_ticks_df.iloc[-1]["id"]
|
||||
# only use cached if it's closer than first_candle_ms
|
||||
|
@ -2712,8 +2716,8 @@ class Exchange:
|
|||
if last_cached_ms > first_candle_ms
|
||||
else first_candle_ms
|
||||
)
|
||||
# doesn't go far enough
|
||||
else:
|
||||
# Skip cache, it's too old
|
||||
all_stored_ticks_df = DataFrame(
|
||||
columns=DEFAULT_TRADES_COLUMNS + ["date"]
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user