Investment Handling in Master Branch

Brendan Coupe 3 at Coupe7.com
Wed Feb 5 23:08:09 GMT 2025


I have attached 6 images of a test KMM file showing the Investment 
Ledger both before and after changing the price from 100 to 1, the 
Investment Brokerage Ledger, the home screen with the net worth, the 
investment section with Manual price update selected and exchange rate 
editor that it brings up. If I change the 100 to 1 on that window, 
everything looks okay.

I imported an OFX file with the purchase of 2 CDs. The net worth should 
be zero and the accounts should have the same absolute value with the 
brokerage being a negative number. As you can see, the Investment Value 
is 100 times greater than the sum of the balance column.

I imported the same OFX file into a different test file using 5.1. When 
I change the price in the ledger (like I did in image KMM2.png) 
everything is fixed. I do not have to take the extra step adjusting the 
exchange rate. The price in the exchange rate screen was already 1 after 
the import and before I changed the price in the ledger so it appears 
the master is handling that differently than 5.1. For some reason it 
sets that at 100 while 5.1 sets it at 1.

I hope this helps. There is too much unrelated info in the OFX file for 
me to feel comfortable sharing it.



On 2025-02-05 1:35 PM, Jack via KMyMoney-devel wrote:
> On 2025.02.05 14:56, Brendan Coupe via KMyMoney-devel wrote:
>> I've been running the master branch on Fedora 41 for several months. 
>> I compile it on my system.
>>
>> When I import my CD transactions from my broker via a downloaded ofx 
>> file, the price is listed as $100 when is should be $1. This has been 
>> an issue in 5.1 for several years and I think it started when I 
>> switched brokers. I have not asked about it since the developers are 
>> busy working on 5.2 and it was easy to correct in 5.1.
>>
>> Since I switched to the master branch, the problem appears to be much 
>> deeper. The $100 price appears to be stored and used for some of the 
>> value calculations. As I bought new CDs, they were all valued at 100 
>> times their actual price. I corrected this by doing a manual price 
>> update in the investment section and changing it from 100 to 1. The 
>> dialog that opens says I'm adjusting the exchange rate for the stock 
>> xxx to USD which seems odd. I leave the date alone but it appears to 
>> be the purchase date. This is far from ideal since i have more than 
>> 100 securities / CDs in several investment accounts so it's hard to 
>> find the ones that need to be fixed.
>>
>> Ideally KMM would recognize the discrepancy and adjust the price from 
>> $100 to $1 when importing the OFX file. I'm guessing this is due to 
>> the broker not following the OFX standard.
>>
>> I think these are the relevant lines in the OFX file when I purchase 
>> a CD.
>>
>> <UNITS>12345
>> <UNITPRICE>100
>> <MKTVAL>12345
>>
>> The UNITPRICE should be 1 and it's obvious the math does not work if 
>> you assume 100 is correct.
>>
>> Oddly enough, the Quantity, Value and Balance columns in the ledger 
>> for the investment account are all correct and the Price column is 
>> wrong. When I update the price in the transaction from 100 to 1, all 
>> of the columns are correct. The Investment Value at the bottom of the 
>> ledger is clearly not based on the total of the Balance column since 
>> it appears to be using the 100 imported from the OFX file. The only 
>> way I can fix this is to find the CD in the investment section and 
>> manually change the price (exchange rate?) from 100 top 1.
>>
>> This extra step was not required in 5.1. When I adjusted the price in 
>> the transaction, the Investment Value at the bottom of the ledger was 
>> correct.
>>
>> I'm also having a problem when I sell CDs. The transaction only shows 
>> in the Brokerage account, not the investment account. I have to find 
>> the original purchase in the Investment account, duplicate it, switch 
>> it from buy to sell and correct the date. Then I match the newly 
>> created transaction in the brokerage account to the imported one. 
>> Unless this triggers a quick fix, lets figure out the first problem 
>> and I will come back to CD sales later since this is not a new 
>> problem in the master branch.
> Brendan,
>
> This is only a superficial response, as anything more involved will 
> require my digging a bit into the internals.
>
> In terms of the brokerage setting the price at 100 instead of 1, I'm 
> guessing it's sort of a unit issue - it's 100 cents even though all 
> other amounts are in dollars.  I have a very vague memory of this 
> being adjustable under some import scenario, but I can't remember 
> where.  Again, I'll have to dig, but perhaps it gives something to 
> hunt for in the configuration or security definition.
>
> In terms of transactions for CDs only showing up in the brokerage 
> account, what is the transaction type as provided by the bank?  It 
> seems you have created a CD as an investment, which is perfectly 
> reasonable, but if the bonk considers the sale as simply a deposit of 
> cash, there is no way OFX or KMM will recognize it as an investment 
> transaction.
>
> At this point - meant only as food for thought.
>
> Jack
-- 

*Brendan Coupe*
*3 at Coupe7.com*

-------------- next part --------------
A non-text attachment was scrubbed...
Name: KMM1.png
Type: image/png
Size: 102621 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20250205/d66a2db4/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KMM2.png
Type: image/png
Size: 102545 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20250205/d66a2db4/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KM3.png
Type: image/png
Size: 117334 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20250205/d66a2db4/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KMM4.png
Type: image/png
Size: 111625 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20250205/d66a2db4/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KMM5.png
Type: image/png
Size: 95631 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20250205/d66a2db4/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KMM6.png
Type: image/png
Size: 29748 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20250205/d66a2db4/attachment-0011.png>


More information about the KMyMoney-devel mailing list