Closed marksandstrom closed 2 years ago
For our live trading account, ib.positions() and ib.portfolio() return inconsistent results, per below:
from ib_insync import * util.startLoop() ib = IB() ib.connect('127.0.0.1', 7496, clientId=1) <IB connected to 127.0.0.1:7496 clientId=1> len(ib.positions()) 5 len(ib.portfolio()) 0
Why is len(ib.portfolio()) 0, while len(ib.positions()) is 5?
The true number of portfolio items is 5.
Thanks for advice!
You probably have multiple accounts. portfolio is for the default account, positions is for all accounts.
portfolio
positions
For our live trading account, ib.positions() and ib.portfolio() return inconsistent results, per below:
Why is len(ib.portfolio()) 0, while len(ib.positions()) is 5?
The true number of portfolio items is 5.
Thanks for advice!