redstreet / fava_investor

Comprehensive set of reports, analyses, and tools for investments, for Beancount and Fava (plain text, double entry accounting software). Includes Fava plugins, command line tools, and libraries for each module.
GNU General Public License v3.0
136 stars 20 forks source link

Design: Investment Performance #26

Open redstreet opened 4 years ago

redstreet commented 4 years ago

Continuing the conversation from the net worth work. Here are some thoughts. Perhaps, more than net worth with Fava already displays on the main page (which is by definition across one's entire accounts, and not restricted to investments), what we are interested in here is investment performance analysis. Refining our goals further:

Investment Performance Analysis: Design Goals

What do we seek to understand?

Let's understand what we may want out of the investment performance analysis component by asking typical questions around this topic:

What does a mock up look like?

We want to show graphs for the following: A. show balances across time

B. balance breakdown across time: show split of 1) contributions, 2) income (dividends, gains, interest, etc.), and 3) appreciation

C. Contributions and withdrawals (cumulative) across time

All these should be:

Eventually, we should have this module also calculate IRR (internal rate of return). I'll flesh this out later.

redstreet commented 4 years ago

@baartosz, I'd love to hear your thoughts. I see what you have is already headed in this direction.

Building out the Investment Performance Module

Here's what I'm thinking with how to build this component. We can focus on one part at a time:

  1. focus on building an awesome account balance display for the selected period (A). The data part is straightforward. First build a text summary. Then build a chart similar to other Fava charts (allowing daily, weekly, monthly, yearly resolution). Then, display the selected accounts with their starting and ending balances for the period in the standard account tree.

  2. Build a contributions/withdrawals analyzer.

  3. build an appreciation analyzer

  4. build a dividends analyzer

  5. Build the balance analyzer. This way, we'll start with the easier problems first, and build up our understanding of what the problems are in building a generalizable component. We could also build out our neat display and charts/graphs in the beginning, so we can focus on the higher level financial aspects later on.

IRR would be the natural follow on.

What do you think?

baartosz commented 4 years ago

Thats pretty close to what I imagined. Module name "Networth" is a bit misleading, "performance" certainly is more accurate. Should we stick to that?

baartosz commented 4 years ago

Queries don't seem suitable for the job. We would need to query plenty of small periods to get data for chart and that's probably going to be slow. Seems like going through all entries and classifying them would work better. What do you think?

redstreet commented 4 years ago

:+1: on classifying entries. Queries are probably useful for prototyping, and also as a reference for testing IMHO.

You could look at what Fava does for its main net worth chart and for the journal. Both of them have a similar problem - i.e., needing to know the balances over short periods of time.

redstreet commented 4 years ago

I've fleshed out the approach in the second post from top. Would love to know your thoughts. I'm excited to see the movement on this. Thank you for the pushing this forward!

baartosz commented 4 years ago

Do I understand correctly that "balance analyzer" is name for a tool that will show split into contributions, dividends and gains using previous tools?

Yes, it looks like good roadmap. Back to prototyping!

redstreet commented 4 years ago

I meant showing just balances without any splitting. So the data part would be very simple and easily analyzable and testable. This lets us build a good foundation for the other elements like UI, code, etc.

baartosz commented 4 years ago

Seems like that screen covers point 1. Is something missing there? https://fava.pythonanywhere.com/example-beancount-file/account/Assets/balances/?interval=year

redstreet commented 4 years ago

You're right, it does, thanks for pointing this out! I tend to use the net worth chart that includes Liabilities, and hadn't thought of this one in a while.

The only thing it may be missing is to choose an arbitrary subset of the accounts through a regular expression. But this is not an often used feature.

It does seem to require a bit of navigation to get it to display that page. If you want to take a few minutes to make it the default tab within performance, that'd be cool. If you want to instead just move on to item 2, that'd be cool too.