Lot matching

phil's Avatar

phil

01 Oct, 2025 06:38 PM

Having made sales of securities with lot matching selected, the capital gains report does not include them unless they have been allocated to original purchases. I recall that previous reports would show them with zero cost which highlighted them for attention. Now I can't easily see which securities require me to allocate sales to purchases. Is there a report to help with this? I am on the latest version of MD.

PS: I am just running a test and find that although I am allocating the precise number of shares to an original purchase the screen is re-setting to blank and requiring input again and again with no effect

  1. 1 Posted by Stuart Beesley ... on 02 Oct, 2025 10:45 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    What version of MD?

    Out of interest. Try this. Launch help/show console.
    Then run CG report again.

  2. 2 Posted by phil on 03 Oct, 2025 08:14 AM

    phil's Avatar

    2024.4(5253) - having checked I am apparently up to date

    I'll try your suggestion once I enter some new sales data

  3. 3 Posted by phil on 09 Oct, 2025 11:50 AM

    phil's Avatar

    UPDATE - I just recorded a couple of new sales, opened the console window, then ran the realised capital gains report - the new sales were missing - I went back to the register and matched the lots - then they showed up in the report - the problem could be averted I guess by having the lot matching window pop up whenever a sale is made.

  4. 4 Posted by Stuart Beesley ... on 09 Oct, 2025 12:00 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    And. Did you do this ?

    Out of interest. Try this. Launch help/show console.
    Then run CG report again.

  5. 5 Posted by phil on 09 Oct, 2025 12:02 PM

    phil's Avatar

    I did but let me do it again in this order

  6. 6 Posted by phil on 09 Oct, 2025 12:21 PM

    phil's Avatar

    Added another couple of sales - opened console - ran report - not showing - went back to match lots - ran report again and there they are

  7. 7 Posted by Stuart Beesley ... on 07 Dec, 2025 09:25 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Ignore last post.

  8. 8 Posted by phil on 07 Dec, 2025 09:40 PM

    phil's Avatar

    It's been a while - I'll check and report back

  9. 9 Posted by Stuart Beesley ... on 07 Dec, 2025 10:07 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    ...

  10. 10 Posted by Stuart Beesley ... on 07 Dec, 2025 11:15 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    ...

  11. 11 Posted by Stuart Beesley ... on 07 Dec, 2025 11:30 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    OK - I see what you are seeing - these were reported in MD2023.3(5064) - date: 13/12/23, but not in MD2024.1(5118) - date: 19/4/24.

  12. 12 Posted by Stuart Beesley ... on 07 Dec, 2025 11:57 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    OK - I almost had it right - my memory failed me... Do this.. Open console.. At the bottom left click (...) and TICK LOG Cost Calculation Engine. You can untick all the other ones.. No re-run the report. You will see your sell zero txns in the CG report.. Let me know?

  13. 13 Posted by Stuart Beesley ... on 08 Dec, 2025 12:07 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Sorry for yet another post... The above is for sell zero shares, but of course your issue is not this, it's sell x shares causing invalid cost basis...

  14. 14 Posted by Stuart Beesley ... on 08 Dec, 2025 12:16 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    So, to conclude this... The reason for the change is that the cost calculation engine (CCE) was upgraded in this time period. It's much superior to what was there before and is a unified single point for all basis calculations.... It seems that when the CCE detects an invalid cost basis (LOT controlled), it essentially wipes that txn from its calculations and any list of gains supplied to the report. I understand that a newer generation of the capital gains report (that will probably be in the next release of MD) detects invalid cost basis and ensures that a line appears on the report for that account/security stating the error, so that you know to go and fix it.. Hope this helps?

  15. 15 Posted by he on 08 Dec, 2025 10:51 AM

    he's Avatar

    Following this because of legal implications for reporting to tax authorities incorrect realized capital gains.

    What exactly is an invalid cost basis, what's the cause and how can be prevented.

  16. 16 Posted by Stuart Beesley ... on 08 Dec, 2025 11:35 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    I think an invalid cost basis is (only) where you have LOT controlled security (account) and where you have NOT LOT matched the sells fully/ properly to buys... If you do not wholly match sells to buys then there is no way to calculate the basis... In real life you cannot sell a lot controlled item without there being a buy before it to match it against...

    It's fine to have buys without sells, but not the other way around..

    Don't ask about short/cover txns with lot control in moneydance. It cannot deal with these...

    Average cost control cannot have invalid cost basis.

    As mentioned, the newer version of the CG report will tell you when there is an invalid cost basis - and it's up to you to go and fix any matching errors...

    (not support, just a fellow user)

  17. 17 Posted by phil on 08 Dec, 2025 08:49 PM

    phil's Avatar

    I'm running version 2024.4 (5253)

    I put a test sell in one account without matching Lots - run CG report and it doesn't show
    Launch console window
    Run report again and still can't see it (even as an error or sale with no cost)
    If I match lots it shows up in the CG report

    So no - not working even with console window open unless I match the lot - but what I really need is some sort of flag that I have forgotten to do it as when sales are entered I'm not prompted to match a lot

  18. 18 Posted by Stuart Beesley ... on 09 Dec, 2025 12:26 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    YUP - I agree with you. You won't make them appear... as per my post 14 above... I think you have actually uncovered a larger issue.. When you have a LOT controlled account, with invalid cost basis - i.e. some sells not matched to buys, then you do not even get the fully matched sells in the capital gains report / valuation either...

  19. 19 Posted by phil on 09 Dec, 2025 07:16 AM

    phil's Avatar

    So what's really needed is a control to prevent a sell entry being recorded unless it has been matched for a lot controlled security.

    I remember that this wasn't always this way. Maybe a year ago (guess) I would run CG reports and get incredible gains shown, because (you guessed it) there was no cost shown. This at least highlighted where I needed to make corrections.

    Any chance we get this issue on the resolution list?

  20. 20 Posted by phil on 09 Dec, 2025 12:30 PM

    phil's Avatar

    I wonder if there is some way to identify all unmatched LOT controlled security sales with a report - I can't see how just yet

  21. 21 Posted by Stuart Beesley ... on 20 Dec, 2025 05:11 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Confirmed. You uncovered a wider issue that I’m surprised no one has highlighted. From MD2024 onwards the report shows nothing when the cost basis is invalid. It should show both the valid matched sells and the invalid ones. And total up the valid gains.

    I have submitted a fix/code proposal to IK for review.

    As for the unmatched sales question. I think it needs a new report. I intend to knock one up sometime and submit it to IK for review. If I get time.

    (Not support, just a fellow user)

  22. 22 Posted by phil on 20 Dec, 2025 05:17 PM

    phil's Avatar

    Thanks for confirming that I'm not going mad - how would I get to know if IK resolve or include your report on their menu?

  23. 23 Posted by Stuart Beesley ... on 20 Dec, 2025 06:49 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    If I do it, and if they accept it, I'll let you know..

  24. 24 Posted by phil on 20 Dec, 2025 07:28 PM

    phil's Avatar

    Thanks - good luck with that - I wouldn't know where to start

  25. 25 Posted by Eric on 04 Feb, 2026 02:25 PM

    Eric's Avatar

    "Don't ask about short/cover txns with lot control in moneydance. It cannot deal with these..."

    I'm going to ask... Why can't it handle short sales? I just upgraded to 2024.4 from 2023.x and was hoping the cost basis issues on short sales would be fixed. I'm seeing Billion $ cost basis in the portfolio reports on a couple thousand $ short sale.
    Fix coming in the next release?

    Thanks.

  26. 26 Posted by Stuart Beesley ... on 04 Feb, 2026 04:35 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    @phil - I understand that the fixes to the cost basis/report when invalid were accepted by IK. No you just need to wait for the next release.

    @eric - there are no fixes that I am aware of regarding the cost basis for short/cover type txns.. It's technically quite complex. I do have some ideas for however to fix it, but it requires using a sudo-lot allocation type method - where you allocate the short and cover together... I don't imagine there being a fix nearby.

    (not support, just a fellow user)

  27. 27 Posted by Stuart Beesley ... on 05 Feb, 2026 03:02 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Take a look at the MD2026 alpha
    https://infinitekind.com/prepreview
    This is alpha - so test data only.

    More info on the Slack beta-testing channel.

  28. 28 Posted by Philip Ladds on 05 Feb, 2026 03:04 PM

    Philip Ladds's Avatar

    Can I just download this after backing up and go? Revert of an issue

    Sent from Outlook for Android<https://aka.ms/AAb9ysg>
    ________________________________

  29. 29 Posted by dtd on 05 Feb, 2026 06:15 PM

    dtd's Avatar

    Don't use MD2026Alpha on live data.

    A sandbox is preferable, but you can install this SEPARATE from your live copy (I have Moneydance, then "Moneydance 26Alpha" installed) then use a backup of your live data versus your live data itself. If you don't have testing experience, you may wish to wait. You do have to keep things separated to insure you don't use live data, as at this point things (including the data you do use) could break. [for example, don't take a copy of the data, then tell it to sync to your other copies!!!!]

  30. System closed this discussion on 07 May, 2026 06:20 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac