Open fly-man- opened 2 years ago
Hi @fly-man-
There is currently only a rough concept how to support dividends in Ghostfolio.
I think the first step would be to introduce a new type DIVIDEND
besides BUY
and SELL
in the transaction management and adapt the portfolio calculations accordingly (performance, net worth).
In a second step, the import of dividends could possibly be automated.
What do you think of this idea? Are you interested in implementing this feature?
I thinks it's a good ideia.
I think we could build a dedicated page just for dividends in the app. Here's some inspiration from Kinvo:
In this page we can see the total value (Total em proventos), amount invested (total investido), dividend yield (rentabilidade), average by month (Média mensal), and in the middle dividends by month and by stock (Proventos por mês). Here's a second screenshot for dividends by month and by stock:
Bellow that we have all entries in dividends (Histórico) and total dividends by stock (proventos por ativo). On the right hand-side there's something very cool we could implement which is an Agenda with upcoming and past dividends in some timeframe. Maybe this part could be build in a second iteration - when importing dividends automatically.
What do you guys think?
I want to help build these features (mainly on back-end, where I'm more proficient). Where do I begin looking in the code?
+1. This feature would be a pillar. I agree with @dtslvr's suggestion to take an incremental approach. Introducing a new transaction type, DIVIDEND, would be an excellent start.
I have set up #547 with the new type.
I think DIVIDEND
is relevant for overall performance, but also it should be reported separately. So a first step could be to extend the tests (portfolio-calculator.spec.ts). Who would like to give it a try?
I can work on the frontend part that a user is able to create and update a dividend.
Thank you very much for considering this feature request and all the great work you are putting into building Ghostfolio.
Current state of #547:
I do not feel sufficiently familiar with the tool stack to help you developing but I am happy to test features.
Also I checked with the Nasdaq website and this might be an easy way to get the dividends as well.
The table is already in the correct format in which you'd expect the data to be
When trying to migrate to the latest version
root@ghostfolio:/opt/ghostfolio# docker-compose -f docker/docker-compose.build.yml exec ghostfolio yarn database:migrate
yarn run v1.22.15
$ prisma migrate deploy
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "ghostfolio-db", schema "public" at "postgres:5432"
19 migrations found in prisma/migrations
Error: P3005
The database schema for `postgres:5432` is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
What is the content of your table _prisma_migrations
@fly-man-?
According to these instructions, you have to tell Prisma which migrations have already been applied.
I guess it's something like
docker-compose -f docker/docker-compose-build-local.yml exec ghostfolio yarn prisma migrate resolve --applied <migration_name>
Edit: Official Prisma documentation to baseline a database
Remade the docker container, that fixed it for me
Dividends is part of the equation if a person makes a profit, at the moment I don't see that in the overview
Thank you, @dtslvr, for releasing the dividend feature. It works well for me (currently purely for logging purposes). Happy to discuss further extensions as outlined in the checklist above.
Thank you, @dtslvr, for releasing the dividend feature. It works well for me (currently purely for logging purposes). Happy to discuss further extensions as outlined in the checklist above.
Thanks for the feedback @FedericoComoglio 🙂
Dividends is part of the equation if a person makes a profit, at the moment I don't see that in the overview
You're right @fly-man-. Currently you can only see the total dividend in the portfolio summary. I would prefer to sort out #554 first before adding more complexity. Any support would be much appreciated.
Just my two cent:
Keep in Mind that a dividend is a corporate action. There are more corporate actions like Splits, Rights, Spin-Offs and so on.. Also Dividend can be cash or stock. Sometimes a dividend is received with withholding tax.
Maybe it is a good idea to add Corporate Actions
and Dividend
as a type of it.
Check also Corporate Actions on Investopdia
Hello, I just came across ths project and I think is great. However, as @fly-man- said "Dividends is part of the equation if a person makes a profit" and this is the main point for Dividend Growth Investors.
Part of my portfolio is based on DGI strategy and the features I miss are:
The "main problem" I see here are taxes. Depending on your country you can have different origin and destination taxes. Unfortunately I have no experience with the tech stack you use, but I can help with testing or anything else.
Is there also an idea / implementation regarding dividend payment that can be registered ?