OpenSteuerAuszug: generate your own eTax / eSteuerauszug for IBKR, Schwab and others

For those who have not tried it yet, but want to see what it produced for a vt-and-chill portfolio (gets updated on every code change):

Many already tried it, and a lot of feedback was processed via GitHub issues. If you have not tried it, give it a try. And please report any issues. This makes this nice piece of software even better.

@Dr.PI Do you think we could update the thread title to make it more clear that this is a working solution for IBKR and Schwab?

3 Likes

Is this based on a real IBKR report or a simulated/synthetic one?

@PhilMongoose It is based on real IBKR data, but simplified and anonymized. A real world data report would look very similar.

@Dr.PI Not sure if any other people with those rights are following this thread. I would suggest the following title “Programmatic Tax Return / e-Steuerauszug for IBKR, Schwab and others”

@Pet what about giving this tool its own post under tax? (Was about to change the title, but large parts of the thread are not about the open source tool, might not be best for people coming from eg search engine).

(That said we’d then need mods to move relevant posts around :confused:)

1 Like

Yes, why not. That would make it more explicit. Feel free to do so and link that new thread in this one.

Hi all,

great project, thanks to everyone contributing!

I tried running the tool with my IBKR Flex Query export and everything works well for stocks, ETFs and cash, but the import fails when the account contains short options positions (e.g. written covered calls). The tool errors out with a “Negative balance” message because it doesn’t expect positions with negative quantities, which is normal for sold options.

As a workaround I removed all options entries from the XML before running the tool, and after that it completed successfully and generated the PDF. But obviously any options-related activity is then missing from the statement.

Has anyone else encountered this? Is options support something that’s on the roadmap?

3 Likes

Is options support something that’s on the roadmap?

Since we do not have sample data for this, we have not implement it yet. If you are willing to create a minimal XML (anonymized), which helps us to reproduce this case, it would be awesome. Best would be if you could post it as a GitHub issue. Otherwise please post it here. Then we can start looking into how to implement it.

3 Likes

Done :white_check_mark:

2 Likes

I tested the XML at

And it seemed to process ok. I’m on holiday now so can’t easily investigate.

I wonder if negative amounts need to be recorded as liabilities instead of short positions. I will need to check the specs.

I recently added a liability schedule, but only cover bank accounts in the first implementation.

I’ve created a new export from IBKR, anonymised it and uploaded it to https://etax.swissforum.co.uk/

Interestingly, the web app processed it successfully and generated a PDF report- including the options trades and the open short position (negative balance) at year end.

However, when I run the same XML file locally against the source code from GitHub, I get the following error during the import phase:

Error during phase import: Negative balance computed for security 841737224 (start 0, end -12)
ValueError: Negative balance computed for security 841737224 (start 0, end -12)

This makes me wonder whether the web application is running a newer or patched version of the tool?

I’ve attached the newly generated XML to IBKR importer crashes on short options positions (covered calls) · Issue #218 · vroonhof/opensteuerauszug · GitHub

The web version has a slightly different version from upstream. I will publish the patches.

2 Likes

I added short positions now to liability schedule, but I wonder how accounts should be treated which start in a short position but evolve to a nil balance? currently if year end balance is >=0, I treat it as a standard security position.

I would suggest that we continue the discussion at GitHub. There we already started working on this and are also discussing it.

Working on two different code forks is not so efficient, I would really try to get the fixes landed into main opensteuerauszug, and then update your web app based on this on a regular basis. The more it diverges, the harder it gets to analyze reported issues.

Regarding negative bank account holdings: I have pushed a PR which converts them to liabilities.

1 Like

Once you are done , would you share the final solution here ?

2 Likes

Here we go: Opensteuerauszug importer (work in progress) for Swissquote. I have not tested it, but looks promising. Another importer for Trading212 has been started as well.

In general, a lot of improvements have been made to opensteuerauszug in the past few weeks. There was a lot of feedback from users, and things have matured a lot.

I have handed in my tax return with a PDF generated by opensteuerauszug - let’s see if there is any feedback of they will just silently accept it. Would be interesting from others as well if there was any feedback of if just worked. Please share your experience.

5 Likes

Hi there. First time posting here.
First of all, thanks for the great work with opensteuerauszug!

I hope I’m at the right place here to give feedback. Everything worked well, only 1 stock (ANGI, ISIN: US00183L2016) was not found. This is still the case after I specifically requested the stock at the ESTV for the Kursliste 2025 and downloaded the list again. I also searched for it in the XML file, and it was there. Could this be a bug?

@jfe Thanks for sharing your feedback. In your case, I assume you did report it to ESTV and they have added it as described here.

I somehow have the feeling, that opensteuerauszug is still reading from the outdated XML file. Please use again the download command to update to the latest XML or copy it manually into the data folder (if you used the download command, it might has stored it into a a different dir, e.g. ~/.local/share/opensteuerauszug on linux).

In case that does not help, you you please post it to the issue tracker together with the relevant anonymized lines of the IB flex export?

Hi @Pet . Thank you for your answer! You were correct, the old automatically downloaded kursliste was used instead of my newly downloaded XML. I did not find the location on my Mac yet. But using the download command again helped. So it seems to have been my fault for not waiting until the kursliste is updated (as described on GitHub). Thanks again.

2 Likes

I have deployed an online version of the current status of OpenSteuerAuszug (just handling IBKR right now for the years 2022-2025) if you want to give it a try without installing it locally. For privacy and security reasons, the supported and suggested way of using it is still local installation.

2 Likes

Thank you for this tool, it’s really useful!

I’m not sure if this is the right place to ask, but I had a question. I tried generating the statement for 2022 after noticing that IBKR made some withholding adjustments in early 2023. I followed the recommended correction method and did see a difference.

However, on the Rapprochement Kursliste / paiements du courtier page, while the Retenue courtier value changes, the KL retenue CHF stays the same. It seems to always be calculated as 15% of the KL dividence CHF, regardless of whether corrections were applied.

Could you clarify why that is? Does the tool not use the actual withheld original currency amount in its calculations, and instead only display it for reference? I thought the purpose of the corrections was to account for cases where the withholding rate isn’t exactly 15%.