Basically, I want to use python to query my IB order history and do some analyze afterwards. But I could not find any existing API for me to query these data, does anyone have experience to do this?
Click the Configure (gear) icon to configure the transaction history to display additional information, including Account ID, Account Title and Method. To view transaction details, click anywhere on a transaction row. Details for the transaction appear in a popup window.
Step 1: Login to Account Management section of the web site and choose the Statements menu item. Step 2: Choose accounts, dates and a format of HTML/Web, and click the View/Download button.
The Transaction History page displays information purchasing and service transactions processed in My Business for the past year.
In the portfolio overview page, scroll down to the trades table and click on the export button to export the trades.
You have to use flex queries for that purpose. It has full transaction history including trades, open positions, net asset value history and exchange rates.
TWS API doesn't have this functionality. You can't retreive order history, but you can get open orders using recOpenOrders request and capture executions in realtime by listening to execDetails event - just write them to a file and analyse aftewards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With