mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-16 21:01:14 +00:00
Improve trades-cached handling
This commit is contained in:
@@ -2703,7 +2703,11 @@ class Exchange:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not all_stored_ticks_df.empty:
|
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"]
|
last_cached_ms = all_stored_ticks_df.iloc[-1]["timestamp"]
|
||||||
from_id = all_stored_ticks_df.iloc[-1]["id"]
|
from_id = all_stored_ticks_df.iloc[-1]["id"]
|
||||||
# only use cached if it's closer than first_candle_ms
|
# only use cached if it's closer than first_candle_ms
|
||||||
@@ -2712,8 +2716,8 @@ class Exchange:
|
|||||||
if last_cached_ms > first_candle_ms
|
if last_cached_ms > first_candle_ms
|
||||||
else first_candle_ms
|
else first_candle_ms
|
||||||
)
|
)
|
||||||
# doesn't go far enough
|
|
||||||
else:
|
else:
|
||||||
|
# Skip cache, it's too old
|
||||||
all_stored_ticks_df = DataFrame(
|
all_stored_ticks_df = DataFrame(
|
||||||
columns=DEFAULT_TRADES_COLUMNS + ["date"]
|
columns=DEFAULT_TRADES_COLUMNS + ["date"]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user