Giter Club home page Giter Club logo

Comments (10)

dickwolff avatar dickwolff commented on July 18, 2024 1

Thanks for reporting this. When I have some time I will look into this!

from export-to-ghostfolio.

sandervankasteel avatar sandervankasteel commented on July 18, 2024 1

Thank you for looking into this! Just one gotcha, the line numbers in the stacktrace are off by 2 lines because I added some debugging to see why it failed and on which of the lines in the CSV file.

from export-to-ghostfolio.

dickwolff avatar dickwolff commented on July 18, 2024 1

I added a check so whenever a match was not found and it's trying to find a partial name match (this resolves the issue with ISHARES NASDAQ US BIOTECHNOLOGY ETF. The Korea one can't be found, so I moved the security availability check directly after searching for it. For some reason I had this later in the loop (with marker checks), but when the symbol is not found the first time, it won't be found the second time either.

Can you try again if the tool now runs and results in an importable JSON?

from export-to-ghostfolio.

dickwolff avatar dickwolff commented on July 18, 2024

I have added some checks so the tool doesn't break when no symbols are found. I also added the Product name from the DEGIRO export to the Yahoo Finance search, and that way (in this case) AMC is found by name. See the code here.

Can you test if this resolves your issue? Thanks!

from export-to-ghostfolio.

sandervankasteel avatar sandervankasteel commented on July 18, 2024

Hey @dickwolff Thank you so far! I've tried your changes, yes this partially solved my issue... But now it breaks on the following CSV lines;

01-08-2023,10:03,01-08-2023,ISHARES NASDAQ US BIOTECHNOLOGY ETF,IE00BYXG2H39,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-1.00,EUR,5.54,4c29dd81-bb01-40fa-8dda-aae3d05dae79
01-08-2023,10:03,01-08-2023,ISHARES NASDAQ US BIOTECHNOLOGY ETF,IE00BYXG2H39,"Verkoop 1 @ 5,416 EUR",,EUR,5.42,EUR,6.54,4c29dd81-bb01-40fa-8dda-aae3d05dae79
25-07-2023,14:31,25-07-2023,ISHARES KOREA,IE00B0M63391,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-1.00,EUR,44.92,d4f45240-d763-4b95-8590-2ba158d38207
25-07-2023,14:31,25-07-2023,ISHARES KOREA,IE00B0M63391,"Koop 1 @ 42,53 EUR",,EUR,-42.53,EUR,45.92,d4f45240-d763-4b95-8590-2ba158d38207

With the following error:

█████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 11% | ETA 176s | Duration: 18s | 107/901/home/sander/tmp/Export-To-Ghostfolio/src/converters/degiroConverter.ts:165                                                                                  
              result.activities[result.activities.length - 1].symbol = security.symbol;                                                                                                                                                       
                                                                                ^                                                                                                                                                             
TypeError: Cannot read properties of null (reading 'symbol')    

What happens is that the Yahoo Finance search returns nothing (ie. it cannot find anything)

getSecurity(): No initial match found, trying by symbol IDKO
getSecurity(): No match found for symbol IDKO, trying by name ISHARES KOREA
No result found for BUY action for IE00B0M63391 with currency EUR! Please add this manually..

But the deGiro converter still tries to add it to it's result.activities array and there it also tries to access it's symbol (which it doesn't has).

So I tried to locally fix this, and what I've done is added an optional chaining (.?) on line 187 and 165,
result.activities[result.activities.length - 1].symbol = security?.symbol; and after that I get JSON file!

from export-to-ghostfolio.

sandervankasteel avatar sandervankasteel commented on July 18, 2024

Thanks for fixing this! I have a now have a JSON blob 🥳

But unfortunately I cannot import it into Ghostfolio at the moment. Ghostfolio is not allowing me to import it because of the following error:

"activities.203.each value in type must be one of the following values: BUY, DIVIDEND, FEE, INTEREST, ITEM, LIABILITY, SELL"

Screenshot:

image

JSON blob mentioned

{
  "accountId": "47ad8e74-9c2e-476e-9cb0-776e8660dea1",
  "comment": "txfees",
  "fee": 2,
  "quantity": 0,
  "unitPrice": 0,
  "currency": "EUR",
  "dataSource": "YAHOO",
  "date": "2020-04-21T09:05:00+02:00",
  "symbol": "VUSA.AS"
}

from export-to-ghostfolio.

dickwolff avatar dickwolff commented on July 18, 2024

Looks like it only found the transaction fees line but not the actual buy/sell line. They are both in the export?

from export-to-ghostfolio.

sandervankasteel avatar sandervankasteel commented on July 18, 2024

Looks like it only found the transaction fees line but not the actual buy/sell line. They are both in the export?

I am seeing some buy and sell lines, but should those buy/sell lines be before or after the fee line?

from export-to-ghostfolio.

dickwolff avatar dickwolff commented on July 18, 2024

Usually, buy/sell records are preceded by transaction fee records, like below:

15-12-2022,16:55,15-12-2022,VICI PROPERTIES INC. C,US9256521090,DEGIRO Transactiekosten en/of kosten van derden,,EUR,"-1,00",EUR,"31,98",5925d76b-eb36-46e3-b017-a61a6d03c3e7
15-12-2022,16:55,15-12-2022,VICI PROPERTIES INC. C,US9256521090,"Koop 1 @ 33,9 USD",,USD,"-33,90",USD,"-33,90",5925d76b-eb36-46e3-b017-a61a6d03c3e7

The tool looks for a buy/sell records after processing a transaction fee line. Given your error below:

{
  "accountId": "47ad8e74-9c2e-476e-9cb0-776e8660dea1",
  "comment": "txfees",
  "fee": 2,
  "quantity": 0,
  "unitPrice": 0,
  "currency": "EUR",
  "dataSource": "YAHOO",
  "date": "2020-04-21T09:05:00+02:00",
  "symbol": "VUSA.AS"
}

This means the tool has read a transaction fee line for VUSA, and then expects a buy/sell record (with that information it can "complete" the record).

from export-to-ghostfolio.

dickwolff avatar dickwolff commented on July 18, 2024

Closing because no response was given. If the issue still persists, please reply so I can reopen the issue.

from export-to-ghostfolio.

Related Issues (20)

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.