Updated: July 30th, 2021

Why do I dread doing taxes every year? One of the main reason was having to figure out ways to import hundreds of transactions from my stock brokers: Scottrade and InteractiveBrokers. I love IB but come on, it's 2008 and they still don't provide .txf files to import into TurboTax (or TaxCut, but I use TurboTax myself). Scottrade, on the other hand, is directly importable through TurboTax but it only imports sale amounts and not purchases, so TurboTax thinks I got my stocks for free and wants to tax me on the full sale amount rather than the profits. That is, of course, very incorrect. Here are the best solutions I could find to these problems:

1. Scottrade.

This one is easy. Instead of doing a direct import through the tax program itself, log into your Scottrade account, go to My Account -> GainsKeeper -> Export Data and download this report available in .txf format: Aggregate Realized for 20XX (whatever the tax year is). It contains both the properly filled out cost bases (amounts paid + commissions) and final sale amounts for all stocks traded. Then just import this file into your tax software. Done.


2. InteractiveBrokers (IB).

Since these guys have been too lazy to write a .txf exporter, only providing HTML, Excel, and PDF reports, you would either have to import all trades manually (yeah right), write a quick script (meh, boring), or use an existing tool to convert these reports into .txf. There are a few tools potentially suitable for this task, some costing hundreds of dollars but the absolute best and cost efficient option I found is InvestoTek Excel macro called ConverExcel2TXF. It only costs $5 and does the job perfectly. Here's what to do:

  • log into your InteractiveBrokers account -> Report Management -> Tax Forms -> Schedule D Gain/Loss Summary Worksheet, select your tax year, MS Excel, and View Report. Now you have an Excel spreadsheet with all trades made.


  • purchase and download the ConvertExcel2TXF macro. There's a trial macro that converts only 2 trades here, so try it out before you buy (but seriously, $5 is nothing). The macro comes as an Excel spreadsheet. Fire it up and enable macros.


  • with the macro spreadsheet running, fire up the IB spreadsheet downloaded earlier. Go to View -> Macros (at least that's where they sit in my Office 2007) and run ConvertExcel2TXF.xls!Run


  • Here's where you have to tell the macro which fields are which – I think it's all pretty self-explanatory. Take a look at a sample from my report:


  • click Generate TXF File and import it into your tax software.

Well, that should do it. Tax time is arduous and stressful, hopefully you'll find this article helpful. Do you know a better way to import trades? Do you do it differently? Please share in the comments.

● ● ●
Artem Russakovskii is a San Francisco programmer and blogger. Follow Artem on Twitter (@ArtemR) or subscribe to the RSS feed.

In the meantime, if you found this article useful, feel free to buy me a cup of coffee below.