I am not sure if anyone will be able to help me with this as this seems to be a very niche problem.
For a while I have been running my script trade.py which creates bracket orders and exits by printing "trades complete". I login to my trade server using ssh and run the script using python3 trades.py
.
However, if I try to automate this by using a python script on my main server, which in turn uses subprocesses run or asyncssh, ssh ¡ host name ¡ python3 trades.py
, the script runs all the way, and prints trades complete, however I do not see any trades being execute.
I checked the logs in both cases and they look exactly the same, as if trades had been placed. But in the second instance no trades are actually executed.
I am not sure why the tws api behaves this way, does anyone have any ideas or suggestions on how I can troubleshoot this issue?