Giter Site home page Giter Site logo

degiro-bookkeeper's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ™‚ Iโ€™m a human being based in Ireland.
  • ๐Ÿ‘ท I work as a software engineer and I hold a PhD in computer science.
  • ๐Ÿ“ซ How to reach me: $name.$surname[at]gmail[dot]com or LinkedIn.

degiro-bookkeeper's People

Contributors

dependabot[bot] avatar pviotti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

degiro-bookkeeper's Issues

Handle and report stock splits

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

  • handle code splits (at least the types of splits I am aware of, as they show up in my account statement...)
  • print out a warning to notify the user that a split happened (since Degiro doesn't...)

Changed description for transaction fees in account statement

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

Transaction description gets mangled in CSV, causes failure

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

Exception thrown on latest export?

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,***********

Handle `ISIN CHANGE` with actual change of ISIN

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.

Output in one ods/xlsx spreadsheet

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.

Improve command line output

...using CLI libraries such as

as long as

  • it doesn't become obnoxious and prevents using standard Unix tools (e.g. cut, grep, etc) to slice and dice text output.
  • it doesn't make the self-contained package too big

(mmmh is it worth it..? ๐Ÿค” )

Support for Spanish Transaction Tax

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).

Report ADR pass-through fees

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,
  • all of them seem to be in USD
  • usually they are associated with dividend transactions
  • the ADR fee amount is summed up with dividend and dividend tax, and then converted to โ‚ฌ in a row in the account statement that is unrelated to the ADR row - so there's no way to automatically compute the amount in โ‚ฌ

It'd be great to report ADR fees at least in USD as part of CLI output.

Anonimize CSV for bug reports

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.

Output withdrawal operations

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.

ETF iShares Core EURO STOXX 50 appears as a Stock

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

Dividends in โ‚ฌ, is it possible?

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?

Support for Manual FX

I have disabled auto-fx and sold some USD shares. Now in the report they appear as 100% loss.

image

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.

Doesn't handle transactions with stock that changed name

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.