pviotti / degiro-bookkeeper Goto Github PK
View Code? Open in Web Editor NEWSimple financial accounting for Degiro.
License: GNU General Public License v3.0
Simple financial accounting for Degiro.
License: GNU General Public License v3.0
Some transactions marked in the Description
field as ISIN CHANGE:
are used by Degiro to mark the change of name or ISIN of a product. Actual change of ISIN is not handled at the moment and causes an error as the Sell transactions doesn't find the corresponding Buys.
It would be good to have in the output also the withdrawal operations (i.e. transfers from DeGiro to an external bank account).
It looks like in the account statements a withdrawal operation produces the following rows:
12-05-2015,16:20,13-05-2015,,,Processed Flatex Withdrawal,,EUR,500.00,EUR,507.65,
12-05-2015,16:20,13-05-2015,,,flatex Withdrawal,,EUR,-500.00,EUR,-1492.35,
11-05-2015,17:08,11-05-2015,,,Processed Flatex Withdrawal,,EUR,-500.00,EUR,507.65,
It seems it would be enough to take all rows that have "Processed Flatex Withdrawal" as description and a positive amount.
...using CLI libraries such as
as long as
(mmmh is it worth it..? ๐ค )
When buying stocks on the Spanish stock market, I see some charges marked as "Spanish Transaction Tax", such as:
31-07-2023,14:54,31-07-2023,INT.AIRL.GRP,ES0177542018,Spanish Transaction Tax,,EUR,-60.00,EUR,1588.17,asdfgasd-asdf-asdf-asdf-asdfgasdfgas
I don't think the software is currently counting these as taxes already paid elsewhere, or to reduce the profits (not sure where it fits).
The logic of this program has been written uniquely based on the Account Statement CSV files its author could access.
It would be great if users could create an anonymized version of their CSV files that they would use to report bugs.
It should not be implemented as default behavior since this is just a peculiar way Irish Revenue office has to compute earnings for taxation purposes, and it's not useful to DeGiro users in other countries.
they went from being:
28-12-2020,15:58,28-12-2020,ACME Inc,US86322M1080,DEGIRO Transaction Fee,,EUR,-0.16,EUR,1379.15,9408d43e-128b-45d8-ad91-6a7b1b3de8ea
28-12-2020,15:58,28-12-2020,ACME Inc,US86322M1080,DEGIRO Transaction Fee,,EUR,-0.50,EUR,1379.31,9408d43e-128b-45d8-ad91-6a7b1b3de8ea
to:
28-12-2020,15:58,28-12-2020,ACME Inc,US86322M1080,DEGIRO Transaction and/or third party fees,,EUR,-0.16,EUR,1379.15,9408d43e-128b-45d8-ad91-6a7b1b3de8ea
28-12-2020,15:58,28-12-2020,ACME Inc,US86322M1080,DEGIRO Transaction and/or third party fees,,EUR,-0.50,EUR,1379.31,9408d43e-128b-45d8-ad91-6a7b1b3de8ea
I have disabled auto-fx and sold some USD shares. Now in the report they appear as 100% loss.
It seems to be failing to link the multi-line sale operation (in USD) with the single USD-EUR exchange. Sales with auto-fx enabled used to work fine.
In the CSV file, with autofx enabled I can see multiple pairs of lines (one per Buy or Sell line):
02-04-2024,15:40,02-04-2024,UNITED CONTINENTAL HOLDINGS,US9100471096,FX Credit,1.0737,USD,3456.78,USD,0.00,aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
02-04-2024,15:40,02-04-2024,UNITED CONTINENTAL HOLDINGS,US9100471096,FX Debit,,EUR,-2345.67,EUR,95.80,aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
However, what I see with auto-fx disabled is one single pair of lines:
18-04-2024,06:57,17-04-2024,,,FX Credit,,EUR,123456.78,EUR,123556.78,
18-04-2024,06:57,17-04-2024,,,FX Debit,1.0699,USD,-234567.89,USD,0.00,
Note that since manual fx operations are not linked to any specific Buy or Sell operation, the last field which used to link the sale and the fx operations is missing, as well as the 4th and 5th fields that indicate the stock which this currency exchange is related to.
dgbk crashes when dealing with malformed rows like:
15-06-2023,17:05,15-06-2023,,,Transfer from your Cash Account at flatexDEGIRO Bank AG:,,,,EUR,12345.67,
,,,,,"6,543.21 EUR",,,,,,
this is then mistakenly cleaned to:
15-06-2023,17:05,15-06-2023,,,Transfer from your Cash Account at flatexDEGIRO Bank AG:"6,,,,EUR,12345.67,
which breaks the CSV parsing (stray double quote).
Use country codes flags (e.g. --country ie
) for country-specific logic (e.g. computing FIFO earnings for Irish Revenue, etc).
(as proposed in #41 )
A reverse stock split is marked in the following way in Degiro account statement:
06-06-2022,14:38,06-06-2022,ACME Inc NEW,CODENEW123456,STOCK SPLIT: Buy 5 ACME Inc [email protected] USD (CODENEW123456),,USD,-87.50,USD,-0.00,
06-06-2022,14:38,06-06-2022,ACME Inc OLD,CODEOLD123456,STOCK SPLIT: Sell 50 ACME Inc [email protected] USD (CODEOLD123456),,USD,87.50,USD,87.50,
At the moment, stock splits are not handled, so if a stock gets turned into another stock (with a different ISIN) as a result of a split, the sell transaction won't find corresponding buy transactions and Degiro Bookeeper will fail with an error similar to the following:
Error: could not find buy transactions for remaining 5 sells of { Date = 8/1/2022 4:57:00 PM 1810.5 K
Type = Sell
Product = "ACME Inc NEW"
ISIN = "CODENEW123456"
ProdType = Shares
Quantity = 5
Fees = -0.50M
Price = 86.43M
Value = 17.8M
ValueCurrency = USD
OrderId = ab2dea5e-1459-425c-96bb-f3124b754b75 }
It'd be great if we could
Great tool, thanks for building it!
I'm quite new to CGT but my understanding is that we should use the FX Rate of the date when we received the dividends. Does Degiro give us enough data to convert the dividends back to EUR?
Currently file output is a set of csv files. It'd be more tidy to have them in a single spreadsheet, be it either in ods or xlsx format.
London/Dublin Stamp Duty
taxes...even though there's no easy way to distinguish ETF from the account statement ๐ค
It'd be handy if it could output (both as CLI and CSV) the buy transactions for ETFs, to be tracked to pay "Deemed Disposal" tax in Ireland.
F# supports defining unit of measures through annotations, which allow compiler to enforce type safety of arithmetic operations. This could be a further safety net to make sure we never do operations using operands with different currencies.
ETF "iShares Core EURO STOXX 50 UCITS ETF EUR (Acc)" (https://live.euronext.com/en/product/etfs/IE00B53L3W79-XAMS) appears in the DeGiro CSV file as "iSHR ESTX50 B A":
"[...],Buy 11 iSHR ESTX50 B [email protected] EUR (IE00B53L3W79),[...]"
Since the name contains iSHR and not ISHARES, it is not being counted as an ETF.
It would appear that this needs a fix in Degiro.Account/Degiro.fs, in the etfDescriptionMarkers array.
Workaround: Edit the CSV before processing, as follows:
cat Account.csv | sed 's/ iSHR / ISHARES /g' > Account-fixed.csv
Currently, it fails if a stock changed its name (column Product
in the Account Statement) between buy and sell transactions.
Matching a sell with corresponding buy transactions should rely on ISIN (column ISIN
in the Account Statement) rather than its stock name.
In some rows of the input CSV, the description of the transactions gets split into two separate rows, making the parsing step fail.
Example:
30-01-2020,10:50,30-01-2020,SHARE NAME B,CODE123,Sell 10 ACME Inc,,USD,72.15,USD,72.15,c6aead59-29c2-40f4-8158-b92cc9b6867e
,,,,,[email protected] USD (US12008R1123),,,,,,
Correct row:
30-01-2020,10:50,30-01-2020,SHARE NAME B,CODE123,Sell 10 ACME Inc [email protected] USD (US12008R1123),,USD,72.15,USD,72.15,c6aead59-29c2-40f4-8158-b92cc9b6867e
According to Degiro fees schedule:
External costs incurred when holding a position in an ADR (American Depository Receipt) will be passed on to the client
So in the account statement we find rows like the following:
04-06-2021,08:10,03-06-2021,PRODUCT ABC,US0IUYWEY,ADR/GDR Pass-Through Fee,,USD,-0.60,USD,-0.60,
It'd be great to report ADR fees at least in USD as part of CLI output.
According to Revenue:
Shares sold within four weeks of acquisition
Shares bought and sold within a four-week period cannot be offset against other gains.
You can only deduct the loss from a gain made on a subsequent disposal of same-class shares acquired within the four weeks.
Is this something you intend to add?
Hi - not sure if this is a bug or if I'm not providing correct format of CSV file, but getting below error when running.
% ./src/Degiro.Cli/bin/Debug/net6.0/dgbk ~/Downloads/Transactions.csv --year 2021
Error: Couldn't parse row 1 according to schema: Expecting DateTime in Value date, got AIRBNB INC-CLASS A
Example first-line of CSV file:
Date,Time,Product,ISIN,Reference,Venue,Quantity,Price,,Local value,,Value,,Exchange rate,Transaction and/or third,,Total,,Order ID
11-10-2022,16:09,AIRBNB INC-CLASS A,US0090661010,NDQ,BATS,-6,104.2000,USD,625.20,USD,644.87,EUR,0.9695,-1.00,EUR,643.87,EUR,***********
11-10-2022,13:43,SRC BBG COM ETF,IE00BD6FTQ80,LSE,XLON,-25,24.3000,USD,607.50,USD,624.23,EUR,0.9732,-3.00,EUR,621.23,EUR,***********
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.