changes implemented
This commit is contained in:
parent
6745788b1c
commit
293717c3ef
@ -12,11 +12,9 @@ import talib.abstract as ta
|
||||
import freqtrade.vendor.qtpylib.indicators as qtpylib
|
||||
import numpy # noqa
|
||||
from datetime import datetime
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
from user_data.strategies.util import launcher, _perform_launcher
|
||||
|
||||
from user_data.strategies.util import launch, back_test
|
||||
from config import Config
|
||||
|
||||
|
||||
class Strategy002(IStrategy):
|
||||
@ -168,7 +166,10 @@ class Strategy002(IStrategy):
|
||||
mode = "test"
|
||||
coin = pair.split("/")[0]
|
||||
brain = "Freq_" + self.__class__.__name__
|
||||
launcher(mode, current_time, coin, brain)
|
||||
if Config.IS_BACKTEST:
|
||||
back_test(current_time, coin, brain)
|
||||
else:
|
||||
launch(mode, coin, brain)
|
||||
|
||||
return True
|
||||
|
||||
|
@ -14,7 +14,8 @@ import numpy # noqa
|
||||
from datetime import datetime
|
||||
import subprocess
|
||||
|
||||
from user_data.strategies.util import IS_BACKTEST, back_tester, launcher
|
||||
from user_data.strategies.util import back_test, launch
|
||||
from config import Config
|
||||
|
||||
|
||||
class Strategy003(IStrategy):
|
||||
@ -181,5 +182,8 @@ class Strategy003(IStrategy):
|
||||
mode = "test"
|
||||
coin = pair.split("/")[0]
|
||||
brain = "Freq_" + self.__class__.__name__
|
||||
launcher(mode, current_time, coin, brain)
|
||||
if Config.IS_BACKTEST:
|
||||
back_test(current_time, coin, brain)
|
||||
else:
|
||||
launch(mode, coin, brain)
|
||||
return True
|
@ -7,12 +7,11 @@ from functools import reduce
|
||||
from pandas import DataFrame
|
||||
# --------------------------------
|
||||
from datetime import datetime
|
||||
import subprocess
|
||||
|
||||
import talib.abstract as ta
|
||||
|
||||
from user_data.strategies.util import IS_BACKTEST, back_tester, launcher
|
||||
|
||||
from user_data.strategies.util import back_test, launch
|
||||
from config import Config
|
||||
|
||||
class Strategy004(IStrategy):
|
||||
"""
|
||||
@ -181,5 +180,8 @@ class Strategy004(IStrategy):
|
||||
mode = "test"
|
||||
coin = pair.split("/")[0]
|
||||
brain = "Freq_" + self.__class__.__name__
|
||||
launcher(mode, current_time, coin, brain)
|
||||
if Config.IS_BACKTEST:
|
||||
back_test(current_time, coin, brain)
|
||||
else:
|
||||
launch(mode, coin, brain)
|
||||
return True
|
||||
|
@ -2,24 +2,24 @@ import subprocess
|
||||
import threading
|
||||
from user_data.strategies.config import Config
|
||||
|
||||
def launcher(mode, coin, brain, date_time):
|
||||
if Config.IS_BACKTEST:
|
||||
def launch(mode, coin, brain):
|
||||
if Config.IS_PARRALER_EXECUTION:
|
||||
threading.Thread(target=back_tester, args=(mode, coin, brain, date_time)).start()
|
||||
threading.Thread(target=_perform_launch, args=(mode, coin, brain)).start()
|
||||
else:
|
||||
subprocess.call("python3 "+Config.EXECUTION_PATH+"launcher.py " + mode + " " + coin + " " + brain, shell=True)
|
||||
|
||||
def _perform_launch(mode, coin, brain):
|
||||
subprocess.call("python3 "+Config.EXECUTION_PATH+"launcher.py " + mode + " " + coin + " " + brain, shell=True)
|
||||
|
||||
def _perform_back_test(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)
|
||||
|
||||
def back_test(date_time, coin, brain):
|
||||
if Config.IS_PARRALER_EXECUTION:
|
||||
threading.Thread(target=_perform_back_test, args=(coin, brain, date_time)).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)
|
||||
|
Loading…
Reference in New Issue
Block a user