Are historical positions or account balances available from the TWS API?

The Trader Workstation, by design, is intended as a real-time trading platform and it does not contain historical trade, position or account balance information. As the API is intended to provide only the data available within the TWS, this historical information is not available via the API as well.

Historical trade, position and account balances is provided via the Activity Statements in HTML and PDF format and are also downloadable via flex queries all in Client Portal.

More information on Flex Queries can be found in our Users' Guide.

Powered by IBot
What types of APIs are available?
How do I obtain historical data via API?
Are stock loan borrow rates available via the API?
Can I use the API with an IBKR Lite account with IBKR Singapore?