Seperate a few commands into specific files

This commit is contained in:
Matthias
2020-01-26 13:08:58 +01:00
parent 6e85280467
commit 926bf07df1
6 changed files with 419 additions and 362 deletions

View File

@@ -0,0 +1,25 @@
import logging
from typing import Any, Dict
logger = logging.getLogger(__name__)
def start_trading(args: Dict[str, Any]) -> int:
"""
Main entry point for trading mode
"""
from freqtrade.worker import Worker
# Load and run worker
worker = None
try:
worker = Worker(args)
worker.run()
except KeyboardInterrupt:
logger.info('SIGINT received, aborting ...')
finally:
if worker:
logger.info("worker found ... calling exit")
worker.exit()
return 0