backtrader connects to diferent instance of TWS
-
hello, I got my algo ready for final phase of tests, running non stop in a paper account in TWS for final validation.
Now I am having an issue, so I open TWS and log into a paper account, I run my algo, my algo does some trades, I can see them happening with logs in my python script, but I don't see them appearing in the TWS window.
I believe the tws window and my algo are running too different instances, is there any way to fix this, so when my algo does a trade I see it appear in TWS?I need this in case of some failure of my algo mid trade, I can manually close the trade and restart my algo.
Best regards
-
@peixoto said in backtrader connects to diferent instance of TWS:
I believe the tws window and my algo are running too different instances
Do you see any changes (like cash changes) in the portfolio window upon order execution?
-
@vladisld no, nothing changes the cash amount, the trade tab and orders tab continues empty. sending here my connection part of my code
store = backtrader.stores.IBStore( port=7497, host='127.0.0.1', clientId=35)
and my tws settings
any idea on why I am having this behavior?
thanks in advance
-
@peixoto The config looks ok. Could you try to pass None for clientId ( that's what I'm using in my system)?
-
@vladisld said in backtrader connects to diferent instance of TWS:
try to pass None for clientId ( that's what I'm using i
I tried to pass None, same result, and after also set the Master API client ID to empty, still the same behaviour. any more sugestion?
Thanks in advance
-
@peixoto hmm, other than looking at the TWS API Log file and see if any order request came through I can't think of anything right now.