-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix bed&breakfast calculation when stock is split #511
Comments
Can you add some minimal examples to test in whatever csv format you are using? Alongside what should be correct reported gain/loss, these cases would help:
Also I believe this is still a hard case because if you sell everything the stock split won't even show up in your export, and there's no way to detect it or warn about that. |
I attach a CSV file with an example split. I also created a test here: #541 which shows where the problem lies (the library consider a split as an 0-cost acquisition). |
I wouldn't worry about fixing it at the moment, I had one idea about it. Just having the 3 examples I listed would be helpful |
Please find the three examples attached. Note that no2 and 3 are actually the same in terms of cgt, as both split and buy after 30 days are tax neutral. |
I guess the first thing we should do is detect b&b when split is involved and abort as unsupported case. Until someone figure out how to calculate this cases properly. |
I am quite sure you do the b&b matching rules with the matching quantity adjusted for the share split ratio. |
Yes, this is what I advocate above and propose strategies for implementing of #541 |
The stock split action in the code is considered a 0-priced acquisition. This works as long as there is no bed&breakfast to consider (no sale in the previous 30 days).
It would be nice to fix the calculation to handle this case as well, or, at a very least, to throw an error to avoid silently incorrect calculation.
The text was updated successfully, but these errors were encountered: