Importing IBKR shows "invalid date" and "not a number" errors

Hello

When I try to import my IBKR transactions, the CSV file generated creates two distinct sections:

1- a header with the stocks and trades including currency conversions

2- a second header later on which is similar but not the same with the “Dividends”, “Withholding Tax” and “Broker Interest Received” under a “Type” column.

the issue is that the AssetClass column in both headers is STK:

  • if AssetClass is STK then it must be a trade - it just processes it as Stock buy/sell.
  • It should also check if the Type column exists and if it does, then it’s a Cash type transaction: “Dividends”, “Withholding Tax” and “Broker Interest Received”

any chance to help address this please? I’ve done a few other modifications to other scripts but for this one as it is a popular broker I fear the maintenance of it and it is hard to just add a multi nested “and if” in the script as it is limited in what can be easily changed.

Happy to send you directly a simple sample if that helps.

thanks.

Hey Polu,

May I ask what do you want to change in the preset (and did in other presets)? The current version should handle the transactions you mentioned out of the box.

As for different sections, it’s possible to add multiple ones, by adding another section from Advanced Options in Data Source settings while importing.

if i try to import, i get this

one of the specific ones that fails is

my diagnostic is: There are two column headers in the IBKR file: header 1 , set of transactions, then header 2, set of transactions (there’s even a last header number 3 after which there is nothing, but that’s not a problem, it just doesn’t recognise it). The first header defines the transaction amount data from “TradeMoney”

first

image

the second one is different: the transaction amount is in “Amount” as there is not a TradeMoney column. see from column W on it all changes.

image

in the existing script, AssetClass is STK so the script tries to import it as a STK transaction but it is actually a dividend/withholding tax transaction defined by column “Type” so that’s why i think it fails.

i don’t enclose a screenshot of the last one but it also could handle the next cash transaction which is INSURED DEPOSIT CREDIT which is described as “Broker Interest Received” in the Type column

I hope that makes sense. thanks for your help

A lot of users are using the IBKR preset, me included, so I’m pretty sure it can work properly and it actually needs these three sections to work (the last one is for transfers). It looks that in your case either the exported sections are wrong, or somehow differ from what we have handled so far and are not recognized properly.

Could you just double-check you have created the Flex Query in IBKR according to the instructions? If yes, please send me a short sample file to support@mycapitally.com so I can have a look on what’s going on.

thanks Rafal - I’m probably doing something wrong, I’ll send you an excel with some transactions, I appreciate the help!

cheers

Just for our future selves - the issue was with the Flex Query in IBKR - Account ID has to be selected (it should be by default) instead of an alias.

1 Like

yes, thank you very much for your help Rafal, I did do a lot of wasted analysis! :laughing: But compliments to you for being so responsive and helpful!!!

1 Like