mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-03 12:51:37 +00:00
Fix bug in --dl-trades downloading
This commit is contained in:
@@ -351,9 +351,10 @@ def _download_trades_history(exchange: Exchange,
|
||||
# DEFAULT_TRADES_COLUMNS: 0 -> timestamp
|
||||
# DEFAULT_TRADES_COLUMNS: 1 -> id
|
||||
|
||||
if not trades.empty and since < trades.iloc[0]['timestamp']:
|
||||
if not trades.empty and since > 0 and since < trades.iloc[0]['timestamp']:
|
||||
# since is before the first trade
|
||||
logger.info(f"Start earlier than available data. Redownloading trades for {pair}...")
|
||||
logger.info(f"Start ({trades.iloc[0]['date']:{DATETIME_PRINT_FORMAT}}) earlier than "
|
||||
f"available data. Redownloading trades for {pair}...")
|
||||
trades = trades_list_to_df([])
|
||||
|
||||
if not since:
|
||||
|
||||
@@ -620,7 +620,7 @@ def test_download_trades_history(trades_history, mocker, default_conf, testdatad
|
||||
|
||||
assert int(ght_mock.call_args_list[0][1]['since'] // 1000) == since_time
|
||||
assert ght_mock.call_args_list[0][1]['from_id'] is None
|
||||
assert log_has_re(r'Start earlier than available data. Redownloading trades for.*', caplog)
|
||||
assert log_has_re(r'Start .* earlier than available data. Redownloading trades for.*', caplog)
|
||||
_clean_test_file(file2)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user