qtpylib
qtpylib copied to clipboard
Support for FA IB accounts
Currently qtpylib doesn't support FA accounts. When using an FA account to log into TWS, no market data is retrieving from IB.
I can confirm this. Related to issue #36
There shouldn't be any difference between an individual or an FA account, as far as QTPyLib is concerned...
The bugs reported in issues #36 and #37 have been fixed with version 1.5.41
. Can you upgrade to the latest version and confirm everything's working as it should now?
To upgrade, run:
$ pip install qtpylib --upgrade --no-cache-dir
Thanks
When connecting to an FA account, the following error is printed.
2016-12-06 13:23:36,430 [INFO] qtpylib.blotter: Connecting to Interactive Brokers...
Server Version: 76
TWS Time at connection:20161206 06:23:35 MST
2016-12-06 13:23:37,489 [INFO] qtpylib.blotter: Connection established...
2016-12-06 13:23:37,546 [WARNING] qtpylib.blotter: [IB #321] Error validating request:-'aV' : cause - Invalid account code '0'.
In my experience, you need to specify the account you are acting on behalf of when using an FA account. This does appear to be working for data access (with exception of futures contracts which I will report in new issue), after recent changes, but will be a problem for trade allocation.
Got it! This makes sense. I'll mark this issue as an #enhancement and try to find a solution in the near future.
Thanks for making me aware of this issue
Here is a relevant part of the API as shared with me by @nwillemse
https://www.interactivebrokers.com/en/software/api/apiguide/java/updateaccountvalue.htm
Looking in to it, tho I can't imagine this will be a quick fix :)
Not a quick one, but not terrible either. There are some other good examples out there that I will see if I can dig up.
👍
Is there any update on this issue? Was the bug fixed?
I still get the same error with the latest version(1.5.82).
2019-02-02 21:10:11,103 [INFO] qtpylib.blotter: Connecting to Interactive Brokers... Server Version: 76 TWS Time at connection:20190202 21:10:11 IST 2019-02-02 21:10:12,169 [INFO] qtpylib.blotter: Connection established... 2019-02-02 21:10:12,214 [ERROR] qtpylib.blotter: [IB #321] Error validating request:-'bl' : cause - Invalid account code '0'.
how to specify an account for trading?
this is fixed? I got the same error: 2020-06-04 00:00:46,852 [ERROR] qtpylib.blotter: [IB #321] Error validating request:-'bq' : cause - Invalid account code '0'.
I got the same error. any fix?
2020-06-19 20:06:15,302 [ERROR] qtpylib.blotter: [IB #321] Error validating request:-'bq' : cause - Invalid account code '0'.
Same error. Doesn't run. Has anybody ever got this working in the last 5 years?
i think it has something to do with:
https://github.com/ranaroussi/ezibpy/blob/main/ezibpy/ezibpy.py#L2209