implemented the script

This commit is contained in:
Bemhreth 2022-01-22 11:20:28 +03:00
parent 3baa7d9268
commit d61c2184fb
2 changed files with 10 additions and 2 deletions

View File

@ -15,7 +15,8 @@ from datetime import datetime
import subprocess
import threading
from user_data.strategies.util import IS_BACKTEST, launcher, back_tester
from user_data.strategies.util import IS_BACKTEST, launcher, back_tester, CURRENT_YEAR, CURRENT_MONTH
class Strategy002(IStrategy):
@ -167,8 +168,13 @@ class Strategy002(IStrategy):
coin = pair.split("/")[0]
brain = "Freq_" + self.__class__.__name__
if IS_BACKTEST:
print("Strategy002:current_time = "+str(current_time))
if current_time.year != CURRENT_YEAR or current_time.month != CURRENT_MONTH:
pass
else:
threading.Thread(target=back_tester, args=(current_time, coin, brain)).start()
else:
threading.Thread(target=launcher, args=(mode, coin, brain)).start()
return True

View File

@ -1,5 +1,7 @@
import subprocess
CURRENT_YEAR = 2020
CURRENT_MONTH = 10
IS_BACKTEST = False
WORKSPACE_PATH = "workspace2" if IS_BACKTEST else "workspace"
EXECUTION_PATH = "/root/" + WORKSPACE_PATH + "/execution/"