parent
fe7108ae75
commit
a6d78a8615
@ -330,13 +330,12 @@ def _download_trades_history(exchange: Exchange,
|
|||||||
try:
|
try:
|
||||||
|
|
||||||
until = None
|
until = None
|
||||||
|
since = 0
|
||||||
if timerange:
|
if timerange:
|
||||||
if timerange.starttype == 'date':
|
if timerange.starttype == 'date':
|
||||||
since = timerange.startts * 1000
|
since = timerange.startts * 1000
|
||||||
if timerange.stoptype == 'date':
|
if timerange.stoptype == 'date':
|
||||||
until = timerange.stopts * 1000
|
until = timerange.stopts * 1000
|
||||||
else:
|
|
||||||
since = arrow.utcnow().shift(days=-new_pairs_days).int_timestamp * 1000
|
|
||||||
|
|
||||||
trades = data_handler.trades_load(pair)
|
trades = data_handler.trades_load(pair)
|
||||||
|
|
||||||
@ -349,6 +348,9 @@ def _download_trades_history(exchange: Exchange,
|
|||||||
logger.info(f"Start earlier than available data. Redownloading trades for {pair}...")
|
logger.info(f"Start earlier than available data. Redownloading trades for {pair}...")
|
||||||
trades = []
|
trades = []
|
||||||
|
|
||||||
|
if not since:
|
||||||
|
since = arrow.utcnow().shift(days=-new_pairs_days).int_timestamp * 1000
|
||||||
|
|
||||||
from_id = trades[-1][1] if trades else None
|
from_id = trades[-1][1] if trades else None
|
||||||
if trades and since < trades[-1][0]:
|
if trades and since < trades[-1][0]:
|
||||||
# Reset since to the last available point
|
# Reset since to the last available point
|
||||||
|
Loading…
Reference in New Issue
Block a user