Bug 410580 - Investment account with brokerage account shows unexpected "Investment Value"
Summary: Investment account with brokerage account shows unexpected "Investment Value"
Status: RESOLVED NOT A BUG
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.0.5
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-04 16:50 UTC by nickfiler
Modified: 2019-08-24 15:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sorry missed the "Choose File" 1st time around! (77.59 KB, image/png)
2019-08-04 16:52 UTC, nickfiler
Details
attachment-11456-0.html (3.30 KB, text/html)
2019-08-05 21:39 UTC, nickfiler
Details
KMyMoney-InvestmentValueBug-StrippedTestVersion-42 .kmy (deleted)
2019-08-09 11:07 UTC, nickfiler
Details
attachment-20080-0.html (4.71 KB, text/html)
2019-08-09 11:18 UTC, nickfiler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nickfiler 2019-08-04 16:50:31 UTC
I've not gone through to see if I can recreate. But I created a new Institution. Added an Investment account with brokerage. Move a deposit to the brokerage account. Bought 4 shares and input their values. Everything appears sensible except for the Investment Account's "Investment Value" which is 25 times too large! My calculator actually says 25.0972994522 times too large.

My other observation was that the "Total" field on buying shares was always a little inaccurate compared to the actaul deal details and checks done with calculator. I simply had a number of shares and a price per share to enter in each case. No fees or interest.


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 nickfiler 2019-08-04 16:52:03 UTC
Created attachment 121930 [details]
Sorry missed the "Choose File" 1st time around!
Comment 2 Jack 2019-08-04 21:50:47 UTC
If you want help here, please stay polite.  There is nothing stupid about those values, or at least we can't conclude that without more information.  In fact, the attachment you posted does not include and "Investment Value" column only "Value" and it seems to correctly be the product of the number of shares and price per share.  I also note that the price per share and value columns are both in Pounds, but there is no symbol on the Balance column, leading me to suspect it is in a different currency.  Might that currency compare to Pounds by a value of about 25?
Comment 3 nickfiler 2019-08-05 21:39:50 UTC
Created attachment 121951 [details]
attachment-11456-0.html

Jack, thank you for your swift response. I'm sorry if I appeared rude. I
did not intend to be. The "Investment Value" is at the bottom right of the
image I sent and except for one investment it behaves exactly as I would
expect showing the summed value of the displayed legger.

I've spent a bit of time today looking at firstly currency setup and
everything appeared OK. I then made myself a copy of my file. Removed most
of the other stuff excepting the bit that appears to behave unexpectedly.

I then deleted and re-bought the 4 test investments one by one. Only one
causes the problem and I have no idea why. But, it happens every time I
re-do it by delete and re-buy. I've checked the setup of that investment
and it appears on screen to exactly match the other investments which do
not cause the problem. I've changed the price entry in case that was the
cause between cost per share and total value. This made only expected
differences to the buying but again suddenly the "Investment Value" goes
from sensible (the sum of the set of investments) to non believeable. Why
it does this is currently invisible to me as the other investments each
work as expected and are set up in an identical manner except that the
stock name/id is different as is the price per share and number of shares -
all of which is expected.

Would a video of my screen help? Otherwise, I suspect I'd need to download
and compile the source and start chasing down what is going on in the code
and/or the data when this share buying transaction takes place?

Thank you

Nick

On Sun, 4 Aug 2019 at 22:50, Jack <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=410580
>
> --- Comment #2 from Jack <ostroffjh@users.sourceforge.net> ---
> If you want help here, please stay polite.  There is nothing stupid about
> those
> values, or at least we can't conclude that without more information.  In
> fact,
> the attachment you posted does not include and "Investment Value" column
> only
> "Value" and it seems to correctly be the product of the number of shares
> and
> price per share.  I also note that the price per share and value columns
> are
> both in Pounds, but there is no symbol on the Balance column, leading me to
> suspect it is in a different currency.  Might that currency compare to
> Pounds
> by a value of about 25?
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 4 Jack 2019-08-05 23:51:30 UTC
First, I have to apologize.  I simply missed the Investment Value.  The Value column at the right is just the total number of shares of that security you own, which in this case is the amount bought in each of those transactions.  There is nothing wrong there.

To make things easier to track down, try a new investment account with a purchase of ONLY the problem security.  Also, if you can produce a .kmy file with only the one investment account and brokerage account with a purchase of that problem security, others can see if we can replicate the problem.

Question - what happens if you change the purchase to use round numbers, say 4000 shares at 2.50 each?  As a test, you could use the same number of shares and same price for each security.  

(Minor hint - if you reply to a bug notice by email, please try to use plain text only, as the html version of the email is made an attachment to the bug.   I'll see if I can have that considered a bug in bugzilla.)
Comment 5 nickfiler 2019-08-09 11:07:58 UTC
Created attachment 122036 [details]
KMyMoney-InvestmentValueBug-StrippedTestVersion-42 .kmy

Sorry, took me a few days to clear out and obfuscate most of the stuff in
the attached whilst retaining the very odd result value. With some energy
it could be de-obfuscated to some extent but it won't tell you much. The
very odd "Investment Value" is still there on the Leger for the "F"
investment account. I've tried changing most of the numbers and they make
no big difference.

I suspect the bug (if it is?) is something to do with how the money to
invest was passed into the brokerage account and was then invested. But it
is only this investment that results in a very unexpectedly large number
appearing bottom right.

I'd be grateful for guidance in avoiding it in future as well as seeing
what appears to be a bug but of course could be a data/user error fixed.

One other issue I have noticed is that on the Investments==>Securities tab
when deleting unused Security details the delete works as expected. But
afterwards, the next item in the list is highlighted but is not seemingly
internally selected until another security is selected by clicking on it,
the previously highlighted but not selected security is then selected and
the Edit/Delete buttons at the right light up from being shaded. This may
be a feature but I suspect it is an accidental difference between the
action at the end of a delete security process and selection of a security
using a mouse click. I've not tested this but I suspect that with just two
existing securities, it might be impossible to select with the mouse - get
Edit/Delete buttons at right highlighted and usable - the 1 remaining one
after deleting the last but one'th security. Not something most real users
will do after they have correctly set their investments up!

Thanks

Nick


On Tue, 6 Aug 2019 at 00:51, Jack <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=410580
>
> --- Comment #4 from Jack <ostroffjh@users.sourceforge.net> ---
> First, I have to apologize.  I simply missed the Investment Value.  The
> Value
> column at the right is just the total number of shares of that security you
> own, which in this case is the amount bought in each of those
> transactions.
> There is nothing wrong there.
>
> To make things easier to track down, try a new investment account with a
> purchase of ONLY the problem security.  Also, if you can produce a .kmy
> file
> with only the one investment account and brokerage account with a purchase
> of
> that problem security, others can see if we can replicate the problem.
>
> Question - what happens if you change the purchase to use round numbers,
> say
> 4000 shares at 2.50 each?  As a test, you could use the same number of
> shares
> and same price for each security.
>
> (Minor hint - if you reply to a bug notice by email, please try to use
> plain
> text only, as the html version of the email is made an attachment to the
> bug.
> I'll see if I can have that considered a bug in bugzilla.)
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 6 nickfiler 2019-08-09 11:18:37 UTC
Created attachment 122037 [details]
attachment-20080-0.html

Hmmmm. I should have editied the de-gzipped file a bit more. Please delete
it from any public facing access?

On Fri, 9 Aug 2019 at 12:07, Nicholas Filer <nickfiler@gmail.com> wrote:

> Sorry, took me a few days to clear out and obfuscate most of the stuff in
> the attached whilst retaining the very odd result value. With some energy
> it could be de-obfuscated to some extent but it won't tell you much. The
> very odd "Investment Value" is still there on the Leger for the "F"
> investment account. I've tried changing most of the numbers and they make
> no big difference.
>
> I suspect the bug (if it is?) is something to do with how the money to
> invest was passed into the brokerage account and was then invested. But it
> is only this investment that results in a very unexpectedly large number
> appearing bottom right.
>
> I'd be grateful for guidance in avoiding it in future as well as seeing
> what appears to be a bug but of course could be a data/user error fixed.
>
> One other issue I have noticed is that on the Investments==>Securities tab
> when deleting unused Security details the delete works as expected. But
> afterwards, the next item in the list is highlighted but is not seemingly
> internally selected until another security is selected by clicking on it,
> the previously highlighted but not selected security is then selected and
> the Edit/Delete buttons at the right light up from being shaded. This may
> be a feature but I suspect it is an accidental difference between the
> action at the end of a delete security process and selection of a security
> using a mouse click. I've not tested this but I suspect that with just two
> existing securities, it might be impossible to select with the mouse - get
> Edit/Delete buttons at right highlighted and usable - the 1 remaining one
> after deleting the last but one'th security. Not something most real users
> will do after they have correctly set their investments up!
>
> Thanks
>
> Nick
>
>
> On Tue, 6 Aug 2019 at 00:51, Jack <bugzilla_noreply@kde.org> wrote:
>
>> https://bugs.kde.org/show_bug.cgi?id=410580
>>
>> --- Comment #4 from Jack <ostroffjh@users.sourceforge.net> ---
>> First, I have to apologize.  I simply missed the Investment Value.  The
>> Value
>> column at the right is just the total number of shares of that security
>> you
>> own, which in this case is the amount bought in each of those
>> transactions.
>> There is nothing wrong there.
>>
>> To make things easier to track down, try a new investment account with a
>> purchase of ONLY the problem security.  Also, if you can produce a .kmy
>> file
>> with only the one investment account and brokerage account with a
>> purchase of
>> that problem security, others can see if we can replicate the problem.
>>
>> Question - what happens if you change the purchase to use round numbers,
>> say
>> 4000 shares at 2.50 each?  As a test, you could use the same number of
>> shares
>> and same price for each security.
>>
>> (Minor hint - if you reply to a bug notice by email, please try to use
>> plain
>> text only, as the html version of the email is made an attachment to the
>> bug.
>> I'll see if I can have that considered a bug in bugzilla.)
>>
>> --
>> You are receiving this mail because:
>> You reported the bug.
>
>
>
> --
> Nick Filer
> 15 Ravensway
> Prestwich
> Manchester M25 0EU
> *Email*: nickfiler@gmail.com
>
Comment 7 Tom Albers 2019-08-09 11:47:38 UTC
The content of attachment 122036 [details] has been deleted for the following reason:

Personal data., per request submitter.
Comment 8 Thomas Baumgart 2019-08-09 11:55:49 UTC
The actual value of an investment is calculated by summing up the products of "number of shares" times "current price". Looking at the data, it shows that the price seems to be the culprit causing the "weird" Investment Value.

The price was downloaded from an online source after the transaction's post date so it is used as current. Take a look at "Tools/Prices" to check it. In case it is wrong, the regex to extract the price from the online source needs to be adjusted. You can manually adjust the price also.

Can you confirm that?
Comment 9 Bug Janitor Service 2019-08-24 04:33:08 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Jack 2019-08-24 15:48:54 UTC
As the strange investment value was due to an imported price more recent than the transaction, I'm closing as NOT A BUG.  If the regexp for the online price update is wrong, that would only be a bug if it was one originally shipped with KMM.