stable/user_data/strategies/util.py
2022-01-26 16:16:32 +03:00

26 lines
1.2 KiB
Python

import subprocess
import threading
from user_data.strategies.config import Config
def launcher(mode, coin, brain,date_time = 12344315):
if Config.IS_BACKTEST:
if Config.IS_PARRALER_EXECUTION:
threading.Thread(target=_perform_launcher, args=(mode, coin, brain)).start()
else:
date = str(date_time)
date = date.replace(" ", "#")
subprocess.call("python3 "+ Config.EXECUTION_PATH + "back_tester.py " + date + " " + coin + " " + brain + " 0.45 3", shell=True)
else:
if Config.IS_PARRALER_EXECUTION:
threading.Thread(target=_perform_launcher, args=(mode, coin, brain)).start()
else:
subprocess.call("python3 "+Config.EXECUTION_PATH+"launcher.py " + mode + " " + coin + " " + brain, shell=True)
def _perform_launcher(mode, coin, brain):
subprocess.call("python3 "+Config.EXECUTION_PATH+"launcher.py " + mode + " " + coin + " " + brain, shell=True)
def back_tester(date_time, coin, brain):
date = str(date_time)
date = date.replace(" ", "#")
subprocess.call("python3 "+ Config.EXECUTION_PATH + "back_tester.py " + date + " " + coin + " " + brain + " 0.45 3", shell=True)