afadil / wealthfolio

A Beautiful Private and Secure Desktop Investment Tracking Application
https://wealthfolio.app
GNU Affero General Public License v3.0
4.39k stars 228 forks source link

stock performance and shares doesn't handle correctly when this stock is split-up or spilt-downs #72

Open Gnomeek opened 2 months ago

Gnomeek commented 2 months ago

Can't handle cases for stock that has been split-up or split-down. For instance, let's say I bought 1 share NVDA(631.6$ per share) at Jan 29, 2024. I should have 10 shares NVDA worthing 1028.3$. Currently this app shows I only have 1 share NVDA with -$528.77 profit.

Screenshot 2024-09-09 at 00 15 56
sosonis commented 2 months ago

That's an issue even with Yahoo finance portfolios. I had to go and edit past transactions and adjust them post-split. Seems that it's not a very easy issue to deal with. Gets even worse with a subsequent split (for eg Apple, NVDA had 2 in recent years).

afadil commented 1 month ago

Added SPLIT activity type in v1.0.18 to log a stock split. It's a basic implementation but should do. Feedback welcomed

sosonis commented 1 month ago

I tried it with the recent 10:1 split of $LRCX. It works, but: "inflates" the portfolio valuation in the past on the assumption that you have x10 shares of LRCX on the x10 price ($840 vs $84 post split for eg), and subsequently shows a drop on the total portfolio value (actually depicting the correct one) after the split date.

I tried what I have been doing in the past with splits, go to my past purchases and adjust them on the split ratio (on number of shares acquired and price per share), but again, because the wealthfolio I guess reads the pre-split pre-adjusted price of the stock, its valuation is inflation, followed by a drop in valuation at the post split date.

From which service are the historic share values pulled from? And does this service adjust for splits?

afadil commented 1 month ago

Can you please try with the latest version. I tweaked split handling and should fix this issue

sosonis commented 1 month ago

Hello I think split works fine. The problem resides on the historic data which have not been updated (yet) to reflect the new post split price. For eg. Lam Research (LRCX) split 10:1 took effect on 10/2/24 but the historic data still shows the pre-split price (and thus a wrongly reported 90%+ drop on the stock price since 10/2/24).

lrcx