Kmymoney investment holdings report

I’ve been using KMYMoney for some time and it’s great. The one serious issue that I have with it is that when I look at the investment holding report, it shows every equity and bond that I’ve ever bought and sold. So 90% of the report are closed positions with an amount of 0. These are not “holdings” any longer and there is no way to fliter them out.

I attempted to use the “Filters” tab to say that the amount needed to be greater than .01 but that didn’t work.

I clone the Github repo and did a grep and found a comment that the Investment Holdings Report is a special case and the rows/columns filters don’t apply.

Sorry for the delay, Discuss is still pretty new here (although it will eventually replace the forums) so we’re not yet used to watching.

Unfortunately, I don’t know if there is an easy (or any) way around this right now. However, I think that comment is perhaps not completely true, as I just ran the Investment Holdings By Account report - and it is for current year to date, and it is not showing any old holdings, only those from this year. I’d have to dig into the code to see any or none of the filters are actually applied.

That might actually be the answer as I have them from the beginning of time until current. Which is the way it always was in every accounting software I’ve ever used. “Holdings” are literally what you’re holding now, not what you’ve already sold. I’ll change the time frame and see what it looks like. But that sort of implies that I would have to move to begin time to after the last thing that I sold.

I appreciate the response.

There are lots of things about Investments that need revising in KMM, but the current effort is on resolving bugs and getting ready for the port to Qt6. I’m working (very slowly) on accumulating all the Investment issues that need to be addressed, and there will eventually be a more public request for input, but not until it is closer to actually being worked on.

One thing that would really help is improved documentation. For example, debugging online quotes I can’t find docs on exactly what KmyMoney is looking for from the regex and I can’t find docs on how to log for debug.

Example; I created a Python script to access a paid subscription service, it appears that KmyMoney is executing it, and I tested the regex that I’m using in a regex tester. But is KmyMoney looking for “Price: 175.50” when I use “Price: (\d+.\d+)” or is it only looking for the dollar figure. There is no information like that. Can I get some debug logs somewhere?

Documentation is always a problem with FOSS. I am the primary
maintainer of the KMM Handbook, and would be extremely happy to get any
specific suggestions for improvements, but I can’t document what I
don’t sufficiently understand. Also, as far as I know, there is
unfortunately limited debug output of any sort available. I am
primarily familiar with debugging OFX import data.

For starts, have you looked at console output? That often provide
additional information, although not for everything.

How well do you understand regexs? “Price: (\d+.\d+)” is looking for
the explicit string "Price: " followed by one or more digits a period
and one or more digits. The parens save that piece of the match to be
used as the price. Nothing about dollar sign or any currency symbol.

One thing that would really help is improved documentation. For
example, debugging online quotes I can’t find docs on exactly what
KmyMoney is looking for from the regex and I can’t find docs on how
to log for debug.
For a stock price, KMM needs two things. First a URL that returns an
html page which includes the desired information. Then it needs way of
finding that info (the price and date) on that page. It uses a regex
(regular expression) for each of them. If a price fetch is failing
(with inability to find the data, not some other type of failure) a way
to debug is to just download the page with curl or wget or even a
browser and save it to a file. Looking at that file in a text editor
can help figure out (assuming the data is actually present) why the
current regex is not working. In all cases, things need to be stable.
The underlying problem here is that Yahoo doesn’t actually want people
to be able to get this data without visually looking at the page (and
all its ads) and so it changes the format on occasion.

There is no dollar sign or currency symbol. What I’d like to know is exactly what KmyMoney is looked for once it executes the regex. The return is:

Symbol: AAPL

Brain fart on my side. I started by creating a reverse proxy with a URL before I realized that I could just run a script. When I converted to a script I changed the protocol from http:// to file:// but forgot to change the get variable to a positional command line variable. After I did that it worked great.