implemented paralller execution
This commit is contained in:
parent
d9f96e2264
commit
40bc3c6319
@ -13,6 +13,8 @@ import freqtrade.vendor.qtpylib.indicators as qtpylib
|
|||||||
import numpy # noqa
|
import numpy # noqa
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import threading
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Strategy002(IStrategy):
|
class Strategy002(IStrategy):
|
||||||
@ -138,6 +140,10 @@ class Strategy002(IStrategy):
|
|||||||
),
|
),
|
||||||
'sell'] = 1
|
'sell'] = 1
|
||||||
return dataframe
|
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,
|
def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,
|
||||||
time_in_force: str, current_time: datetime, **kwargs) -> bool:
|
time_in_force: str, current_time: datetime, **kwargs) -> bool:
|
||||||
@ -162,6 +168,7 @@ class Strategy002(IStrategy):
|
|||||||
"""
|
"""
|
||||||
mode = "test"
|
mode = "test"
|
||||||
coin = pair.split("/")[0]
|
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
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user