Closed swissbuechi closed 6 months ago
Thanks for creating this issue. I appreciate the detailed description!
Are trades and dividends always exported seperately (so not both in the same file?)
You could combine them to the same file, but it would just copy the content of the second file below the first one. With new headers, etc...
Gotcha!
I will work something out later this week and get back to you so you can do some testing!
You're awesome!
This might also help figuring stuff out, this program syncs ghostfolio with IBKR maybe u can take a look and see how they do it? Appreciate your work so far!
https://github.com/agusalex/ghostfolio-sync
Also ghostfolio seems to have an example here what a format from IBKR should look like so ghostfolio can support it.
https://github.com/ghostfolio/ghostfolio/blob/main/test/import/ok-vti-buy-on-ibkr.csv
I have created an initial version the IBKR converter. You can clone it for local running here and run with npm run start ibkr
, or pull this Docker image (0.7.0-beta).
One thing I found was that the SELL orders you provided as an example don't have an ISIN. So they can't be matched to a security. Is this an error with your export, or don't they ever have an ISIN?
Great, thank you!
One thing I found was that the SELL orders you provided as an example don't have an ISIN
There are no SELL orders in my report, I've never sold something... The SELL orders you see without ISIN are just currency exchanges from CHF to USD.
Real SELL orders should look the same and also have an ISIN I think...
This might also help figuring stuff out, this program syncs ghostfolio with IBKR maybe u can take a look and see how they do it? Appreciate your work so far!
https://github.com/agusalex/ghostfolio-sync
Also ghostfolio seems to have an example here what a format from IBKR should look like so ghostfolio can support it.
https://github.com/ghostfolio/ghostfolio/blob/main/test/import/ok-vti-buy-on-ibkr.csv
Wow, it seems like Ghostfolio has native support for importing IBKR BUY/SELL Orders. Works for me, I guess...
And Dividends can be auto-imported... So the only thing missing is the Withholding Tax.
@swissbuechi
Importing Buyworks fine.
Great!
Importing Dividends works also fine. But, do you really want to add the description to the record? I have done this for all converters as far as I recall, so I also did it here. This way you have the original reference (if present).
Importing Withholding Tax did not work. Is this intended?
There was one dividend in your example that is being processed without fees (0).
This is not working for you?
The SELL orders you see without ISIN are just currency exchanges from CHF to USD.
Ah, that would be an interpretation error on my side. Thanks for clarifying!
Wow, it seems like Ghostfolio has native support for importing IBKR BUY/SELL Orders.
I did not know this. Great that Thomas has this support built in.
There was one dividend in your example that is being processed without fees (0).
I was talking about the Withholding Tax
line:
"Withholding Tax","20230913","CH0111762537","SMMCHA(80486947) CASH DIVIDEND CHF 5.99 PER SHARE - CH TAX","-14.68","CHF"
Shouldn't this be imported as Fee
?
@swissbuechi I'm sorry, withholding tax is included in the tool! The tool matches the dividend tax lines to the correct dividend lines.
As you see with the line above, the fee
value contains the withholding tax value, and the other part is the normal dividend values.
@swissbuechi I'm sorry, withholding tax is included in the tool! The tool matches the dividend tax lines to the correct dividend lines.
Alright I see, thank you.
If there aren't any other issues, could you provide me with export instructions like these so I can add those to the readme? Much appreciated!
Open Interactive Brokers Account Management
Click Reporting in the sidebar
Click on the Flex Queries tab in the Reporting section.
From the Flex Queries section, Click the plus (+) icon on the right side to create a new Flex Query.
Create a new Flex Query for Trades and another one for Dividends
Trades
Trades
Buy/Sell
, TradeDate
, ISIN
, Quantity
, TradePrice
, TradeMoney
, CurrencyPrimary
, IBCommission
, IBCommissionCurrency
Dividends
Cash Transactions
Type
, SettleDate
, ISIN
, Description
, Amount
, CurrencyPrimary
Select Format = CSV
Save Query
Run Query and select time frame
Thanks a lot! I will add the instructions to the readme later this week, probably friday.
I've added the readme and merged the PR! Thanks for your help!
It would be awesome if you could support IBKR. I've created a custom flex query for the trades and dividends + taxes. I'll create a small explanation on how to create the query, if you decide to implement this broker.
Trades
IBCommission
fromTradeMoney
, this is already done. I could also add theMoney
without the fees subtracted, if you prefer.Trades.csv
:Dividends and Taxes
Dividends_Taxes.csv
Amount
byPrice per share
(extracted fromDescription
string).(\d+(\.\d+)?)(?= PER SHARE)