-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature #3237: dividend yoc #3248
base: master
Are you sure you want to change the base?
Feature #3237: dividend yoc #3248
Conversation
@Nirus2000 |
Generally, and without having looked at the changes themselves, it would be good if you could clean up/rebase your branch.
The changelog is the commit history. A summary is given on the forums with each release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven’t looked at the actual calculation.
...en.portfolio.tests/src/name/abuchen/portfolio/snapshot/security/DividendCalculationTest.java
Outdated
Show resolved
Hide resolved
name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/SecuritiesPerformanceView.java
Outdated
Show resolved
Hide resolved
name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/StatementOfAssetsViewer.java
Outdated
Show resolved
Hide resolved
name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/StatementOfAssetsViewer.java
Outdated
Show resolved
Hide resolved
name.abuchen.portfolio/src/name/abuchen/portfolio/money/Values.java
Outdated
Show resolved
Hide resolved
name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/ReportingPeriod.java
Outdated
Show resolved
Hide resolved
...buchen.portfolio/src/name/abuchen/portfolio/snapshot/security/SecurityPerformanceRecord.java
Outdated
Show resolved
Hide resolved
name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/StatementOfAssetsViewer.java
Outdated
Show resolved
Hide resolved
Thanks @Marfir for the contribution. Generally it looks good (although personally I am very skeptical what YoC actually tells you as investor, I know there are many folks asking for this) Before discussing the algorithm, let me make a couple remarks:
Then about the algorithm:
My proposal:
|
name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/security/DividendCalculation.java
Outdated
Show resolved
Hide resolved
A bit of algorithm discussion had happened on the forums when @tquellenberg was working on this, starting from here and going on for about fifteen posts.
I think (as I already stated in that forums discussion) that we should stay consistent and honour the selected reporting period. Otherwise it will be doubly confusing. ;-) |
If this are requirements then it should be part of the readme/contributors.md! It's my first contribution to this project. I don't know the workflow of this project. And I don't know how I can change all my past commits to fulfill your proposals. |
Thx for the review. :-) To the calculation: |
Yes there is also an older discussion here: Using the selected period then you will get a wrong number in case of last dividend payments are changing big in compare to past payments. I can fix the tool tip to make it more clear that 1 Year was used? |
name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/messages.properties
Outdated
Show resolved
Hide resolved
name.abuchen.portfolio/src/name/abuchen/portfolio/model/AccountTransaction.java
Outdated
Show resolved
Hide resolved
name.abuchen.portfolio/src/name/abuchen/portfolio/model/PortfolioTransaction.java
Outdated
Show resolved
Hide resolved
name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/messages_de.properties
Outdated
Show resolved
Hide resolved
Just FYI - I am on the road and will be able to look into this only next week :-( |
@Nirus2000 |
Hey @Marfir Greetings |
9368327
to
f3fb7ef
Compare
Now I squashed all my commits into one. Hopefully I do no mistake. This was my first manual squash... |
From one extreme to the opposite … Each logical change (of which here is more than one) should have its own commit. – In any case you should rebase onto current master (which would remove the duplication of changes that happened there) before splitting the commit into logical steps again. Furthermore, it doesn’t seem you addressed many of the other issues from the comments. |
OK, so I had hoped that adding a comment would cause Github to re-expand the conversations that you have, prematurely, marked as resolved, but unfortunately it doesn’t. I’ll need to repeat here:
It doesn’t work like that. You may not like the current Further, I absolutely disagree with your opinion that “it needs to be a part of the class that the builder construct”. Stuff that is only used to make tests more readable should not clutter the main code.
Similar to the above: You are not alone in this project. You may prefer to store “+10%” as Regarding |
Sorry. Because of this I ask for the workflow and got the answer "Everything is fine so far.".
Yes there should be only one builder per class. If it's not allowed to using deprecated annotations in this project then it will be hard to improve the code. I'm sure nobody has the time to refactor the complete project. I create this builders because I see the existing tests that did not using it and I did not see the hidden builder classes. All this project specific things should be part of the contributors.md that every (new) developer can follow it from the beginning.
Same problem. Hidden magic in questionable classes that is nowhere documented.
If I should delete my builder classes then this issue does not matter. |
Is this your personal favorite to using git or is this a requirement of this project? If it's a project specific requirement then it should be part of the contributors.md. |
Okay, let me first make a meta-comment: When in Rome, do as the Romans do. The code base is 11 years old, some patterns have no right or wrong but are determined by personal preferences (spaces vs. tabs - anyone?), not all technical debt can be fixed in one pull request. As I commented above, I do not plan to add yet another builder pattern or change the way I reflect percentages in the code. And all this discussion drew energy away from the actual point - the yield on cost. So I propose to focus on that one |
FYI, here the draft implementation by @tquellenberg mentioned in this forum posting: https://github.com/tquellenberg/portfolio/commits/dividend_yoc |
Let me share my observations from reading the forum thread (which I hadn't done before - time constraints plus not being a dividend investor):
I have these questions on my mind:
What do you think? (plus: should we move the conceptual discussion back to the forum thread? And: I'll mark this as draft until we have a agreed understanding on the indicator) |
Good question. I did not consider this in my algorithm. I think the algorithm needs to detect if there are buys or sells in the 12M period (to increase the position by 80% would also give a wrong YoC number) and adjust the numbers.
The interval strongly depends on how the user try to make money. If the user is a long term investor (stock picker, funds or ETF) then the last 12M would make sense. But if the user is a day trader or gambler then the complete feature make no sense for him or a day-based YoC is needed. I prefer the last 12M for myself and maybe the most of the other people too. We can start a survey in the forum about the "right"/expected period? I already visualized it in the UI. Please take a look into the properties files that I extended. There should be no confusions about the period if the user can read!
I don't understand why the user should do manually this things? If I receive a dividend then I input the amount and the number of shares in the divi dialog. The received divi's of the last 12M are the base of the calculation. We have already what we need to calculate the correct YoC.
Yes we could copy this ideas to the forum and as the others if it should work in that way or not. Also a survey about the used period would be interesting. |
see issue #3237
I will add a dividend yield per cost for each security in the portfolio.