0

IBApi account summary request only pulls current account information. Is there a way to request historical account information? For example, historical net liquidation value to calculate the historical performance of the portfolio.

TG_01
  • 73
  • 8

1 Answers1

1

Short answer no. The API can only access data/functions already available in the TWS, and that historical account information (other than recent trade activity) is not available in TWS.

The reports on the IB account web page are comprehensive and will give you more than enough historical information; but will likely require a manual download, or at least can't be requested programmatically through the API.

You will likely need to keep track locally yourself of all trade activity in the account if you want something that works autonomously. I do that, and it was a non-trivial exercise to set up.

DavidWalker
  • 336
  • 1
  • 8
  • Thank you. Can you share what your setup is? – TG_01 Sep 16 '22 at 15:07
  • Short version: I have a trade object to which I write all information related to the trade (including ib contract, order objects, executions, commissions, and all related calculations). Callbacks from the API are monitored, the related trade object is found, and the callback object is written to the trade object. It may not be the best system, but it's what I use. There are some publicly available code libraries which you could study to see how they do it in detail (e.g. backtrader, quantconnect etc.) – DavidWalker Sep 18 '22 at 08:22