portfolio-performance / portfolio

Track and evaluate the performance of your investment portfolio across stocks, cryptocurrencies, and other assets.
http://www.portfolio-performance.info
Eclipse Public License 1.0
2.83k stars 585 forks source link

Possible improvements to (transaction) CSV importer #3616

Open pfalcon opened 10 months ago

pfalcon commented 10 months ago

CSV transaction importer with all its column typing and mapping is really smart and neat feature. It still falls short in various real-world cases, this ticket tries to enumerate seemingly low-hanging changes which can improve it:

  1. For the "(transaction) type", the mapping is "PortfolioPerformance internal operation" -> "value from CSV column". That's needlessly limiting, because it assumes there's a one-to-one mapping from PP's operation to what may appear in a random statement around the world. But maybe there's stuff like "Buy" vs "Buy to open" vs "Buy to close", or maybe there're different ways of depositing/transferring. So, the mapping should be the opposite, "value from CSV column" -> "PortfolioPerformance internal operation". And there should be support for many-to-one mapping. It may be a challenge (or chore) to support that in UI, but as long as that mapping can be edited in CSV importer JSON config which can be exported/imported, that's already a great improvement.
  2. CSV forcibly ignores amount signs, by calling Math.abs(). This seems to be a generic problem with PP, see e.g. https://github.com/portfolio-performance/portfolio/issues/3450. For CSV importer, this enforces unrealistic model when each transaction would be explicitly classified as "buy" and "sell". Instead, a buy transaction would be one with the negative amount and sell - with positive (sign definitely depends on the "side" of the statement, the above is from the point of view of cash account). So, again, CSV should not just throw away sign, but use it instead.
  3. There should be a way to specify a quote feed for newly imported securities, that's https://github.com/portfolio-performance/portfolio/issues/3450. Failing way to do that in UI (a chore to implement), a "golden standard" default feed should be set, which is Yahoo Finance.
pfalcon commented 10 months ago
  1. CSV forcibly ignores amount signs

Posted https://github.com/portfolio-performance/portfolio/pull/3617 for this.