Git Product home page Git Product logo

Comments (5)

erikwt avatar erikwt commented on July 28, 2024 1

I think calculating performance like that only works if there is no in- or outflow of cash. Using something like Time-Weighted Return would be much more accurate and meaningful imo. Would you consider adding something like that? If not I will add it to my backlog, but I'm not sure if I will get to it in the near term as my focus is more on the data visualisation of the absolute values at this point.

I'm also curious - just in general - if you plan to work more on this project. At some point in the future I think I'll either try to use your project as a library (the parsing part), or move away from it altogether after incorporating the parser. I don't know yet when it makes sense to do so, as it's obviously beneficial if we make use of each others improvements. Any thoughts?

I want to say thanks again by the way, I can't believe how lucky I was to find your project - which was started so recently but already works so well! My project, which is a web project based around visualizing the portfolio data, will be open source as well.

from dgpc.

CNugteren avatar CNugteren commented on July 28, 2024

First off, thanks for open sourcing this work, nicely done! I was super lucky to run into this. I just started a very similar side-project and it looks like I can build a POC of what I have in mind on top of this.

Nice to hear. Do share a link to it here when it is ready :-)

I had some trouble getting started because of parsing issues, and I submitted fixes through a PR. Also, some transaction types are not yet supported, like "Rente" and a few others. I think I'll add those at some point.

Thanks, I saw them. Yes, everything that is currently supported is based on what I've seen in my own account. I didn't have any other data when I wrote it, but I hope I made it such that it shouldn't be too difficult to add other types.

I also plan to look into the currency conversion, because the one used now does not match what is paid through degiro, probably because the bid/ask spread. I do believe it's possible to derive it from the data though.

I think one of the reasons it doesn't match is that I base it on the final value of that day, and not on a particular hour/minute moment on that day. I'm not sure if that data is easily available, but I thought this would be approximate enough to generate useful graphs.

The bigger problem I see is that bank_cash and nominal value don't get calculated correctly

I admit the bank-cash idea might not fit everyone's use case and is something we could also consider removing entirely indeed. My philosophy was that booking money out is never going to happen - unless you temporary put it on your own bank-account to get a higher interest. Eventually that money will go back to the DeGiro account and stock can be bought again. This is of course not true but it did fit my scenario. Do you think there is a bug with the bank-cash implementation or is it just that it doesn't fit your scenario? You should see the red line as DeGiro cash + bank cash.

So I'm OK with removing this concept as you suggested in the code, but now we get issues with the bottom graph showing the relative figures and the benchmarks being less meaningful. Perhaps we can keep the concept of bank-cash for the purposes of the benchmark graphs but just deduct the value from some of the curves in the top graph?

from dgpc.

CNugteren avatar CNugteren commented on July 28, 2024

Using something like Time-Weighted Return would be much more accurate and meaningful imo

Yes I guess that makes sense to do. I could see if it is not that difficult to do. I hope that it doesn't change any numbers if you compare it to the current implementation with the bank-cash concept. However, that still leaves the benchmark ETF graph, which is currently exactly as I want it to be for my use-case as well. What to do there with withdrawals?

if you plan to work more on this project

Currently it does everything for my use-case, so I don't plan to work actively without specific requests. I will of course look at pull-requests, but don't expect me to contribute too much. If you want, I could also make you a contributor/owner of this project?

as it's obviously beneficial if we make use of each others improvements. Any thoughts?

This is still a small project with few users written in a few hours, so I'm not sure we have to go through great lengths to do the very best possible. I would also be OK if you just use the parser separately in your own project and not propagate updates to DGPC, if that gives you more freedom?

from dgpc.

CNugteren avatar CNugteren commented on July 28, 2024

I found some time and implemented the TWR computation according to your link, removed the bank cash concept, and reorganized some code a bit. You can find the results here: #3

However, I'm not sure it is correct, so please have a look. In the example graphs the difference is not so big (but still there is something) between the actual returns:
new_graph

I don't have a background in finance, so I don't understand why the performance can't be calculated by dividing the total account value by the money you've put in at a given time, which is what I used before to compute the account performance graph. Also in the example from the link you gave, I would say not 21.49% gain, but 21.88% gain: (25992 - 1500 + 250) / 20300.

The values I have plotted now for my own data (not shared here) according to the TWR computation would indicate I had at one point a 50% return (which I understand as e.g. 20K money put in and current value at 30K - but this didn't happen) and never had a return below 0%, but I did have less money in my account than invested this March. So either my calculation/understanding is wrong, or the TWR is a value that doesn't tell me much :-)

from dgpc.

erikwt avatar erikwt commented on July 28, 2024

That's awesome! I'm going to check it out validate the calculations. I'll post a more elaborate response later.

from dgpc.

Related Issues (3)

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.