And set up the spreadsheet

1. Log into you Interactive Brokers account

2. Go to Performance & Report

3. Click Flex Queries

4. Click the + button to create new Activity Flex Query

5. Name It

6. Scroll lower and click on Trades

7. Select all and confirm at the bottom of page

8. Select format as csv


10. Change date format to dd/mm/yyyy

11. check if the values are the same and confirm at the bottom of page

12. Click create at the bottom of next page and you will get a message that query has been created

13. Click the small arrow next to created query to run it

14. Chose your period (you can import one year of data in-between dates) and set format to csv

15. Now you need to wait a bit for it to create it. You can refresh it by that little refresh button

16. When its ready – click the arrow button and it should download

Spreadsheet set up

This way I have imported more than Two years of data. You can export data by date range (every range is up  to one year of data).  

Lets open the spreadsheet and start importing data!

1. Go to buttons sheet

2. Click Delete data button.

Do this only the first time when you open the spreadsheet or when you want to delete all of your data.

3. Click Import trades, chose your csv file, confirm

4. Click Web trades

You will get a popup message: There’s already data here. Do you want to replace it? Click OK

It will run all of the necessary operations. It might take some time, dependable on quantity of the data.

5. Go to data sheet and scroll to the last row of data

Check for incomplete rows. And DELETE them. To do it, just select the row numbers by holding CTRL key. Then right click it on the number and DELETE.  This is due to trades what are not closed.  

Previously I imported Year of 2021 from 3rd of February 2021 to 3rd of February 2022. I deleted dates starting from 24th of January 2022, so the next import I gonna start from there.

So I’ll go back to buttons page and hit IMPORT TRADES and WEB TRADES again. And it will add the next batch of Trades.

6. Now i’ll go At row 300 to make sure there is no errors

As you can see below, I have one error row due to trade what was closed previously. Thats because trade was opened on 19th of January but closed on 24th. And as we imported from 24th onwards it will show that close of trade.

We just simply select the row and delete it.

Be AWARE! IF YOU DELETE A ROW IN-BETWEEN DATA, it will show errors. TO FIX IT, go back to BUTTONS sheet and press EXTEND FORMULAS button. That will fix everything.

Once all of the import is done click The refresh button in buttons sheet.

You also can find a REFRESH ALL button in MAIN sheet.