From 40bc3c6319ed0ca6bdc7b5a21b7488e30940ef12 Mon Sep 17 00:00:00 2001 From: Bemhreth Date: Fri, 14 Jan 2022 23:44:55 +0300 Subject: [PATCH] implemented paralller execution --- user_data/strategies/Strategy002.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/user_data/strategies/Strategy002.py b/user_data/strategies/Strategy002.py index 2fc5cfce4..168f239b7 100644 --- a/user_data/strategies/Strategy002.py +++ b/user_data/strategies/Strategy002.py @@ -13,6 +13,8 @@ import freqtrade.vendor.qtpylib.indicators as qtpylib import numpy # noqa from datetime import datetime import subprocess +import threading + class Strategy002(IStrategy): @@ -138,6 +140,10 @@ class Strategy002(IStrategy): ), 'sell'] = 1 return dataframe + + def call_launcher(self, mode, coin): + print("strategy002: call_launcher: mode = " + mode + " coin = " +coin) + subprocess.call("python3 /root/workspace2/execution/launcher.py " + mode + " " + coin, shell=True) def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, current_time: datetime, **kwargs) -> bool: @@ -162,6 +168,7 @@ class Strategy002(IStrategy): """ mode = "test" coin = pair.split("/")[0] - subprocess.call("python3 /root/workspace/execution/launcher.py " + mode + " " + coin, shell=True) + thread = threading.Thread(target=self.call_launcher, args=(mode,coin)) + thread.start() return True