Bug 494827 - Stock split ratio won't allow for accurate Schwab ETF stock split
Summary: Stock split ratio won't allow for accurate Schwab ETF stock split
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.3
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-15 20:53 UTC by Matthew Schultz
Modified: 2024-10-19 09:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Schultz 2024-10-15 20:53:22 UTC
I'm running kmymoney 5.1.3.  Schwab just did a 3-for-1 split on their SCHB ETF on Thursday Oct 10, 2024 which I have several shares of.  If I enter a stock split transaction with 3 as the ratio, then it's not correct because of the way Schwab handles a split.  For example, I had 242.2707 shares before the split but if I enter 3 as the ratio for the split, I get 726.8121 shares.  This is not correct because Schwab gives me 726.2707 shares after the split and then deposits cash in my brokerage account for the remaining 2 parts of the fractional share split (0.5414) while keeping the original fractional share (0.2707) invested.  I tried a workaround by entering 2.99776530963092111427 which should yield 726.2707 as the amount of shares I have now but it shows up as 726.2700 which means the investment value is off by a little.  Is there possibly another workaround for this or can kmymoney be enhanced to support this scenario properly?
Comment 1 Jack 2024-10-15 21:28:39 UTC
I suppose one possibility would be to allow KMM to split less than the entire number of owned shares, but I'm not certain it's a good idea, and it wouldn't happen soon.  In your case, one approach would be to do the full 3:1 split, and then sell the extra partial shares for the amount Schwab paid you.  It's not a strictly accurate representation of what happened, but it leaves your balances correct.
In the long run, perhaps we can switch this to a wishlist for an option to split whole shares only and consider the value of the partial shares some sort of dividend.  You might then also need to specify whether or not you get the one extra share if your partial is over on third of a share.   Certainly worth thinking about.
Comment 2 Matthew Schultz 2024-10-16 00:58:20 UTC
(In reply to Jack from comment #1)
> I suppose one possibility would be to allow KMM to split less than the
> entire number of owned shares, but I'm not certain it's a good idea, and it
> wouldn't happen soon.  In your case, one approach would be to do the full
> 3:1 split, and then sell the extra partial shares for the amount Schwab paid
> you.  It's not a strictly accurate representation of what happened, but it
> leaves your balances correct.
> In the long run, perhaps we can switch this to a wishlist for an option to
> split whole shares only and consider the value of the partial shares some
> sort of dividend.  You might then also need to specify whether or not you
> get the one extra share if your partial is over on third of a share.  
> Certainly worth thinking about.

That's a good idea to sell the shares after the split but something goes wrong with the split as well.  242.2707 shares with a 3-for-1 split becomes 726.8100 in the balance instead of 726.8121.  Then when I sell the 0.5414 shares, the balance yields 726.2686 shares (should be 726.2707) which throws off the investment value as well.  Why does the balance start to miscalculate as soon as I add the 3-for-1 split?
Comment 3 Jack 2024-10-16 01:06:12 UTC
First, if you reply to a bug by email, please remove everything except your reply.  Your entire message becomes the next entry in the bug, and all the extra (which is right above in the previous entry anyway) clutters it up and can make it harder to follow.
It sounds like there might be some rounding issues, but I'll have to find time to sit with a calculator.  Can you confirm the precision settings for that stock?
One quick fix is to just sell the number of shares which brings the balance back to what it should be, but I do suspect we can identify the cause of the problem.
Comment 4 Matthew Schultz 2024-10-16 01:38:05 UTC
(In reply to Jack from comment #3)

Sorry for the clutter.  I set the fraction to 1/10000.  The balance calculation was correct before the split but the split transaction stopped calculating it correctly.  In the interim, I just did the stock split and then did a sell share transaction for less than the actual shares "sold" and adjusted the price as well so the deposit into the brokerage reflects properly.  At least now the investment value is accurate.  Thanks for the help!
Comment 5 Jack 2024-10-16 02:42:42 UTC
That's why I always have it set to enter the total price for the transaction instead of the price per share.
Comment 6 Thomas Baumgart 2024-10-19 09:26:27 UTC
I tested this against master (5.2): using the 1/3 split and adjusting the shares balance with an addition sell transaction works there. Also the workaround using the adjusted split as 2.99776530963092111427 results in 726.2707 shares (so no calculation problem in this version), but the balance on the brokerage account might be wrong in this case, as the payout is missing.

I think we can turn this into a wish list item to add a buy/sell (transaction) split for a stock split operation to accommodate for such scenarios.