add back_test throttle
This commit is contained in:
parent
42645aee00
commit
dcbdaec4a2
@ -8,3 +8,4 @@ class Config:
|
||||
WORKSPACE_PATH = "workspace2" if IS_BACKTEST else "workspace"
|
||||
EXECUTION_PATH = "/root/" + WORKSPACE_PATH + "/execution/"
|
||||
IS_PARALLEL_EXECUTION = True
|
||||
BACKTEST_THROTTLE_SECOND = 1
|
||||
|
@ -1,6 +1,7 @@
|
||||
import subprocess
|
||||
import threading
|
||||
from user_data.strategies.config import Config
|
||||
import time
|
||||
|
||||
def execute(mode, coin, brain):
|
||||
if Config.IS_PARALLEL_EXECUTION:
|
||||
@ -17,6 +18,7 @@ def _perform_back_test(date_time, coin, brain):
|
||||
subprocess.call("python3 "+ Config.EXECUTION_PATH + "back_tester.py " + date + " " + coin + " " + brain + " 0.45 3", shell=True)
|
||||
|
||||
def back_test(date_time, coin, brain):
|
||||
time.sleep(Config.BACKTEST_THROTTLE_SECOND)
|
||||
if Config.IS_PARALLEL_EXECUTION:
|
||||
threading.Thread(target=_perform_back_test, args=(date_time, coin, brain)).start()
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user