Merge pull request #1 from tef-github/paraller_execution
35. implemented paralller execution
This commit is contained in:
commit
85d9ddfb06
@ -13,6 +13,9 @@ import freqtrade.vendor.qtpylib.indicators as qtpylib
|
||||
import numpy # noqa
|
||||
from datetime import datetime
|
||||
import subprocess
|
||||
import threading
|
||||
|
||||
from user_data.strategies.util import thread_executor, IS_BACKTEST, launcher, back_tester
|
||||
|
||||
|
||||
class Strategy002(IStrategy):
|
||||
@ -162,6 +165,9 @@ class Strategy002(IStrategy):
|
||||
"""
|
||||
mode = "test"
|
||||
coin = pair.split("/")[0]
|
||||
subprocess.call("python3 /root/workspace/execution/launcher.py " + mode + " " + coin, shell=True)
|
||||
if IS_BACKTEST:
|
||||
threading.Thread(target=back_tester, args=(current_time, coin)).start()
|
||||
else:
|
||||
threading.Thread(target=launcher, args=(mode, coin)).start()
|
||||
return True
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
|
||||
# --- Do not remove these libs ---
|
||||
import threading
|
||||
|
||||
from freqtrade.strategy.interface import IStrategy
|
||||
from typing import Dict, List
|
||||
from functools import reduce
|
||||
@ -12,6 +14,9 @@ import numpy # noqa
|
||||
from datetime import datetime
|
||||
import subprocess
|
||||
|
||||
from user_data.strategies.util import IS_BACKTEST, back_tester, launcher
|
||||
|
||||
|
||||
class Strategy003(IStrategy):
|
||||
"""
|
||||
Strategy 003
|
||||
@ -175,5 +180,8 @@ class Strategy003(IStrategy):
|
||||
"""
|
||||
mode = "test"
|
||||
coin = pair.split("/")[0]
|
||||
subprocess.call("python3 /root/workspace/execution/launcher.py " + mode + " " + coin, shell=True)
|
||||
if IS_BACKTEST:
|
||||
threading.Thread(target=back_tester, args=(current_time, coin)).start()
|
||||
else:
|
||||
threading.Thread(target=launcher, args=(mode, coin)).start()
|
||||
return True
|
@ -1,4 +1,6 @@
|
||||
# --- Do not remove these libs ---
|
||||
import threading
|
||||
|
||||
from freqtrade.strategy import IStrategy
|
||||
from typing import Dict, List
|
||||
from functools import reduce
|
||||
@ -9,6 +11,8 @@ import subprocess
|
||||
|
||||
import talib.abstract as ta
|
||||
|
||||
from user_data.strategies.util import IS_BACKTEST, back_tester, launcher
|
||||
|
||||
|
||||
class Strategy004(IStrategy):
|
||||
"""
|
||||
@ -176,5 +180,8 @@ class Strategy004(IStrategy):
|
||||
"""
|
||||
mode = "test"
|
||||
coin = pair.split("/")[0]
|
||||
subprocess.call("python3 /root/workspace/execution/launcher.py " + mode + " " + coin, shell=True)
|
||||
if IS_BACKTEST:
|
||||
threading.Thread(target=back_tester, args=(current_time, coin)).start()
|
||||
else:
|
||||
threading.Thread(target=launcher, args=(mode, coin)).start()
|
||||
return True
|
||||
|
11
user_data/strategies/util.py
Normal file
11
user_data/strategies/util.py
Normal file
@ -0,0 +1,11 @@
|
||||
import subprocess
|
||||
|
||||
IS_BACKTEST = False
|
||||
|
||||
EXECUTION_PATH = "/root/workspace2/execution/"
|
||||
|
||||
def launcher(mode, coin):
|
||||
subprocess.call("python3 "+EXECUTION_PATH+"launcher.py " + mode + " " + coin, shell=True)
|
||||
|
||||
def back_tester(date_time, coin):
|
||||
subprocess.call("python3 "+EXECUTION_PATH+"back_tester.py " + date_time + " " + coin, shell=True)
|
Loading…
Reference in New Issue
Block a user