pyFIFOtax icon indicating copy to clipboard operation
pyFIFOtax copied to clipboard

overhaul: add support for stock splits and automated awv reporting

Open stadlmax opened this issue 1 year ago • 5 comments

  • support for stock splits
  • support for automated AWV reporting
  • use decimal.Decimal for a more robust handling of floating point numbers
  • round sales proceeds as Schwab seems to do so for sub-cent values
  • introduce new format for transactions, separating RSUs and ESPPs to e.g. allow automated reporting for AWV purposes or to allow a more generic treatment of currency conversions

stadlmax avatar May 28 '24 21:05 stadlmax

Thanks for the fixes, it works now! Interestingly, in most of the logging code I had to remove the .date() except for data_structures_fifo.py::pop()::sell_date StockSplitEvent::date In these cases if I remove the .date() function, then it prints the whole datetime.

Good finding, weirdly enough, things in general just worked before. What I missed. pandas uses a pandas timestamp class to denote timestamps which are more or less compatible with datetime.datetime. I now explicitly convert to datetime.date when loading from these dataframes, so any instance where now things are not a datetime.date object are unintended for sure.

stadlmax avatar Jul 23 '24 13:07 stadlmax

DEGIRO import runs now (with the manual handling of the known unsupported buy/sell stock at the same day variation).

wait, you actually have buy and immediately sell use-cases? :D what should be supported now is selling stocks and directly using the proceeds to buy other stocks.

stadlmax avatar Jul 23 '24 13:07 stadlmax

#10 passes all tests now, let's get everything ready to merge! :)

szotsaki avatar Aug 17 '24 08:08 szotsaki

Great news, would you mind going over the conversations to see if there is still a comment not addressed? I'll do the same :)

stadlmax avatar Aug 18 '24 22:08 stadlmax

yfinance issues seems like a show-stopper for unfortunately

stadlmax avatar May 30 '25 23:05 stadlmax

@szotsaki likely not nicely or over-engineered, but i revisited the historical prices through YF again

  • now with a manual and human-readable cache (i.e. in case YF breaks in the future again, it would be possible to potentially share or manually update some csv files)
  • tested things with more recent releases of YF (0.2.62/0.2.63) and things seem to work again

stadlmax avatar Jun 28 '25 11:06 stadlmax