Merge pull request #7441 from freqtrade/train-queue

Ensure train ordering after restart
This commit is contained in:
Matthias 2022-09-19 19:33:16 +02:00 committed by GitHub
commit a023ac26f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -702,7 +702,8 @@ class IFreqaiModel(ABC):
"""
current_pairlist = self.config.get("exchange", {}).get("pair_whitelist")
if not self.dd.pair_dict:
logger.info('Set fresh train queue from whitelist.')
logger.info('Set fresh train queue from whitelist. '
f'Queue: {current_pairlist}')
return deque(current_pairlist)
best_queue = deque()
@ -711,12 +712,13 @@ class IFreqaiModel(ABC):
key=lambda k: k[1]['trained_timestamp'])
for pair in pair_dict_sorted:
if pair[0] in current_pairlist:
best_queue.appendleft(pair[0])
best_queue.append(pair[0])
for pair in current_pairlist:
if pair not in best_queue:
best_queue.appendleft(pair)
logger.info('Set existing queue from trained timestamps.')
logger.info('Set existing queue from trained timestamps. '
f'Best approximation queue: {best_queue}')
return best_queue
# Following methods which are overridden by user made prediction models.