qtpylib icon indicating copy to clipboard operation
qtpylib copied to clipboard

multiple account support

Open githubbla opened this issue 7 years ago • 6 comments
trafficstars

[WARNING] qtpylib.blotter: [IB #321] Error validating request:-'be' : cause - Invalid account code 'U20XXXXX,U21XXXXX,U21XXXXX,U21XXXXX,'.

Is there any workaround?

githubbla avatar Feb 23 '18 21:02 githubbla

Is this a FA account?

ranaroussi avatar Sep 12 '18 13:09 ranaroussi

do not think so. it's a regular login with a few accounts.

githubbla avatar Sep 12 '18 13:09 githubbla

Can you confirm this still happens when using version 1.5.80?

ranaroussi avatar Sep 12 '18 18:09 ranaroussi

Yes, still happens

Requirement already up-to-date: qtpylib in lib/python3.6/site-packages (1.5.80)

2018-09-13 01:29:27,791 [INFO] qtpylib.blotter: Connecting to Interactive Brokers... Server Version: 76 TWS Time at connection:20180913 01:29:27 IST 2018-09-13 01:29:28,824 [INFO] qtpylib.blotter: Connection established... 2018-09-13 01:29:29,550 [INFO] qtpylib.blotter: Contract Added [QQQ] 2018-09-13 01:29:29,842 [ERROR] qtpylib.blotter: [IB #321] Error validating request:-'bh' : cause - Invalid account code 'U2XXXX,U2XXXX,U2XXXX,U2XXXX,'.

When I specify accountCode = "U21234569" - one of the listed accounts, I getting following one:

2018-09-13 01:30:07,127 [ERROR] qtpylib.blotter: [IB #321] Error validating request:-'bh' : cause - Invalid account code '0'.

githubbla avatar Sep 13 '18 05:09 githubbla

I'm trying to figure this out... Where do you specify accountCode = "U21234569"?

ranaroussi avatar Sep 15 '18 10:09 ranaroussi

` if name == "main": blotter = MainBlotter( dbhost = "localhost", # MySQL server dbname = "qtpy", # MySQL database dbuser = "qtpyuser", # MySQL username dbpass = "qtpypass", # MySQL password ibport = 4001, # IB port (7496/7497 = TWS, 4001 = IBGateway) accountCode = "U21234569" )

` now i get with or without accountCode same error: 2018-09-15 08:31:27,237 [ERROR] qtpylib.blotter: [IB #321] Error validating request:-'bh' : cause - Invalid account code '0'.

githubbla avatar Sep 15 '18 12:09 githubbla