Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

reqAccountSummary often times out #689

Open
thorpep138 opened this issue Feb 1, 2024 · 3 comments
Open

reqAccountSummary often times out #689

thorpep138 opened this issue Feb 1, 2024 · 3 comments

Comments

@thorpep138
Copy link

Hey team--

I noticed that when I call reqAccountSummary it often times out, even when I give a timeout of 2 minutes. Does anyone know why this might be? Here is the relevant code snippet:

def get_account_balance_with_timeout(self, timeout):
        # Request account summary
        ib.reqAccountSummary()
        
        # Wait for the account summary update with a timeout
        if not ib.waitOnUpdate(timeout=timeout):  
            raise Exception("Fetching account balance timed out.")

        # Filter for TotalCashBalance
        account_summary = ib.accountSummary()
        for item in account_summary:
            if item.tag == 'TotalCashBalance' and item.currency == 'USD':
                return item.value

        return None
@thorpep138
Copy link
Author

@erdewit

@thorpep138
Copy link
Author

When I set the timeout to 10 seconds it also sometimes works and sometimes doesn't:

image

@gsy1xy
Copy link

gsy1xy commented Feb 6, 2024

don't install the latest version of TWS. Try it with TWS version:10.19

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants