Account data, buying power, orders, positions, 322 error? #148
Unanswered
secbitchris
asked this question in
Q&A
Replies: 2 comments 1 reply
-
async def check_account(self):
|
Beta Was this translation helpful? Give feedback.
0 replies
-
what's the error that you are having? if i do import ib_async
ib_async.util.startLoop()
ib = ib_async.IB().connect("tws", 7499, clientId=100)
ib.accountSummary()
ib.accountValues()
ib.portfolio()
ib.positions() everything works as expected |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What has to happen for account data to work?
async def check_account(self):
"""Check account information"""
try:
# Cancel any existing account summary requests first
try:
logger.info('Canceling any existing account summary requests...')
self.ib.cancelAccountSummary(9999) # Cancel with a high reqId to catch any existing requests
await asyncio.sleep(0.1) # Give time for cancellation to process
except Exception as e:
logger.info(f'Account summary cancellation (expected if none active): {e}')
the current code i'm using is above.
How does this work? I can get live price data, options chains, etc, but I cannot get account data. I have an account with proper market data subscriptions, IBKR pro, API enabled.
Beta Was this translation helpful? Give feedback.
All reactions