Tutorial on importing manual trades from Interactive Brokers into Live Book

Hi all,

I’d like to give back to the community before my free trial expires, so here’s a tutorial on how to import manual trades from Interactive Brokers into Live Book transactions.

  1. Go into IB account management
  2. Navigate to Reports → Trade Confirmations → Flex Queries → Create New Flex Query
  3. Set query name to portfolio123, output to Text, output format as Comma, include column headers checked
  4. Set period to Last N Calendar Days 2 or whatever period you want to import
  5. Set date format to MM/dd/yyyy
  6. Set fields included to ReportDate, Symbol, Buy/Sell, Quantity, Price, Commission - in that order.
  7. Set Level of Detail to Order
  8. Save the query and run it. Open the CSV file in Excel
  9. Copy and paste the non-header rows into the Transactions / Import function of Live BOOK

Note: for BUY and SELL transactions of a single stock, the BUY transactions have to be imported in a separate import prior to the SELL transactions, otherwise the following error will be thrown by the import function - Line 4: Error inserting transaction: No position for SYMBOL

P.S.: The Rebalance Portfolio window in IB TWS under New Window → More Advanced Tools can be used to calculate quantities for manual rebalance orders in the case that one no longer has access to the Live Book rebalance function.

I believe you also have to invert the sign of the commission column?