Skip to content

Commit 33549a6

Browse files
committed
fix: add small offset to allow since to be slightly different
1 parent a0bc3d9 commit 33549a6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

freqtrade/data/history/history_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from freqtrade.exchange import Exchange
2020
from freqtrade.plugins.pairlist.pairlist_helpers import dynamic_expand_pairlist
2121
from freqtrade.util import dt_now, dt_ts, format_ms_time
22+
from freqtrade.util.datetime_helpers import format_ms_time_det
2223
from freqtrade.util.migrations import migrate_data
2324
from freqtrade.util.progress_tracker import CustomProgress, retrieve_progress_tracker
2425

@@ -431,11 +432,11 @@ def _download_trades_history(
431432
# DEFAULT_TRADES_COLUMNS: 0 -> timestamp
432433
# DEFAULT_TRADES_COLUMNS: 1 -> id
433434

434-
if not trades.empty and since > 0 and since < trades.iloc[0]["timestamp"]:
435+
if not trades.empty and since > 0 and (since + 1000) < trades.iloc[0]["timestamp"]:
435436
# since is before the first trade
436437
raise ValueError(
437-
f"Start {format_ms_time(since)} earlier than "
438-
f"available data ({trades.iloc[0]['date']:{DATETIME_PRINT_FORMAT}}). "
438+
f"Start {format_ms_time_det(since)} earlier than "
439+
f"available data ({format_ms_time_det(trades.iloc[0]['timestamp'])}). "
439440
f"Please use `--erase` if you'd like to redownload {pair}."
440441
)
441442

0 commit comments

Comments
 (0)