How to remove 'old' securities from the system?

How can I remove old securities which has been sold from the system?
When running the ‘consistency check’ it’s reporting some errors, like no price set for … (see attached screenshot) but nowhere (so it seems to me) I can correct this error.
Therefore I want to remove some entries totally from the system since my investment strategy has changed and therefore no need to keep them in KMM anymore.
I would like to clean them out from the system.
… sorry for raising so many questions.
Any help is much appreciated.

KMM version 5.1.3-2fecc3fb5 on Linux Mint 20.4

First, I don’t see a screenshot, but the “No price set for…” is usually about not having a price for the security on or before the opening day of the security account within the investment account. It’s a warning, not an error, but the easiest way to eliminate the warning is just to enter the needed value.
Second, I would suggest you reconsider removing that information, as it changes the history. In order to remove a security, you basically need to remove any evidence it was ever present, so your net worth would decrease inappropriately for the duration during which you did hold that stock. I would just close the relevant accounts so they simply do not show up in most views and reports.
Finally, if you still want to remove a security, as I said, you need to remove all evidence of its presence. You need to remove all prices for that security, and all transactions that reference it. You should then be able to delete it from the Equities tab of the Investments View - that removes the account which held the security in the Investment Account. Finally, you should be able to delete it from the Securities tab of the Investments View - that removes the underlying definition of the security. The only other thing I can think of is the possibility of needing/wanting to remove the currency, but only if that security was absolutely the only thing in your data file which was associated with that currency.

Thanks for you posting.
I know it really goes into the nitty-gritty of the data storage.
I’m aware that deleting the securities would paint a false picture when looking back in history.
But I’m more interested in a smooth solution and reflection of the current situation than on a view what was realistic nn years ago.
For completion I attached the screenshot I forgot to upload earlier.
I will sleep over it what’s to do :slight_smile:

As I thought, those are all warnings, not errors, and can be ignored, except for the repeated annoyance of the warnings. What happens is that when a new security account is created, a price is not necessarily added for that date. This depends on what exactly triggered the creation of the account. I believe there is an existing bug filed so that this warning is only generated if there is no price available on or before the date of the first transaction in that account referring to that security. Since the first transaction is most commonly a BUY, the warning should be much less common. (ADDing some shares could cause this, if you don’t also enter a price for that date.)
If you still want to delete all these, then start by deleting all transactions for the security, then the prices, then the entry on the Equities tab, and finally the entry on the Securities tab. I’d say at least create a good backup before you start, just in case you ever want to go back and see the full history.

1 Like