Cost Basis isn't calculating correctly for history reports in the 'Portfolio' report

rjgiskard's Avatar


09 May, 2020 04:48 PM

Hi there,

I've just begun having a play with the 'Portfolio' report, which is quite nice.

But I was curious to backdate the report to look at earlier snapshots and noticed what seems to be a bug: the 'cost basis' column doesn't recalculate, and is instead always shows the current (today's date) 'cost basis' of the current number of stocks.

Gains also seems off, but I'm guessing that's because it uses 'cost basis' (or perhaps vice versa?), and fixing one will fix the other.


  1. 1 Posted by sth on 09 May, 2020 10:33 PM

    sth's Avatar

    Do you mean that it doesn't adjust for different # of shares when asking for the portfolio report. I see that recent purchases are not included as number of shares in an older report as I expect. Maybe if you could give a simple example? Or even better create a new account with a single security showing this effect?
    (Not IK Support)

  2. 2 Posted by rjgiskard on 10 May, 2020 08:38 AM

    rjgiskard's Avatar

    Hi sth,

     > Do you mean that it doesn't adjust for different # of shares when
    asking for the portfolio report.

    The report shows the correct number of shares for the report date, but
    not the correct cost of those shares: cost basis appears to always
    calculate on today's date, not the date the report's being run for.

    I'm replying by email and not sure if the screenshots are going to take,
    but here goes.

    I started a brand new file and added a single investment account called
    'Invest Account', associated a single security called 'Security A', and
    recorded a small number of transactions, shown here:

    Should the screenshot not come through, here're the transactions:

    * 1 May: xfr'd £100
    * 1 May: bought 20 shares at £1/share
    * 2 May: bought 20 shares at £1.5/share
    * 3 May: bought 20 shares at £2/share

    Here's the portfolio report when run with default setup, for today (10 May):

    Again, if the screenshot doesn't come through:

    Shares: 60
    Price: 2
    Cost Basis: 90
    Gains: 30
    Balance: 120
    1/3/5 year 5: None
    All %: high number, guessing because I'm giving myself a high return

    When I backdate the report date to 2 May, which is before my 3rd buy:

    Shares: 40 (correct)
    Price: 1.5 (correct)
    Cost Basis: 90 (not correct - should be 50)
    Gains: -30 (not correct - should be 10)
    Balance: 60 (correct)
    1/3/5 year 5: None
    All %: high number, guessing because I'm giving myself a high return

  3. 3 Posted by markritchie on 16 May, 2020 01:46 PM

    markritchie's Avatar

    I ran into this issue today and a quick search of the discussions shows that this has been reported at least as far back as Moneydance 2015. So I guess we just have to ignore the cost basis on the Portfolio report if we use a date other than the current date.

  4. 4 Posted by rjgiskard on 17 May, 2020 06:26 PM

    rjgiskard's Avatar

    I think investing is becoming more common than ever before, so hopefully
    the devs take notice of this bug as more of us post here to say we're
    affected by it.

  5. 5 Posted by sth on 17 May, 2020 11:22 PM

    sth's Avatar

    I have been away for a bit, so I apologize for not getting back to you. I have seen no issue with my securities and wonder if it is something odd in your stock history prices.

  6. 6 Posted by sth on 17 May, 2020 11:44 PM

    sth's Avatar

    I thought it might have to do with the price history, the transaction and the portfolio being on the same day. Did the pricing happen before or after the purchase that happened before or after the portfolio report. I spaced out transactions and see the same error. In fact the price should be the average price of 1.25/share after the second purchase.

  7. 7 Posted by rjgiskard on 18 May, 2020 06:26 AM

    rjgiskard's Avatar

    Edit: initially replied by email after reading the email from your first reply; after reading your second, I see my reply is moot... So editing...

    From your last post, I gather you’re seeing the issue now, too?

    In my test, the buys were consecutive days. In real life, these are transactions going back years. If I backdate the Portfolio report to any date prior to my last buys/sells, the cost basis is still calculated for the current date. So the further back I try to see a snapshot of my portfolio at the time, the worse the report.

  8. 8 Posted by sth on 18 May, 2020 12:44 PM

    sth's Avatar

    I am pretty sure I understand the issue. The only weirdness I was trying to eliminate is if you ask for a portfolio report as of May 3. And you purchased securities on May 3, does the report include that purchase. What about the price change that is entered on May 3 as well. It was a question of the off by one scenario on the date. The version I posted avoids that by spacing the purchases out with an extra day in-between.

    Either way the average price per share, the number of shares and the total basis costs should be consistent. Instead of showing screen shots, I posted the whole test case for the developer to work on.

  9. 9 Posted by rjgiskard on 18 May, 2020 02:20 PM

    rjgiskard's Avatar

    Hi sth, Please see above post 7. I had replied by email after reading post 5, but before reading post 6. I edited my response a few minutes later after reading post 6. So I think we're on the same page here.

  10. 10 Posted by Garth on 27 May, 2020 08:23 PM

    Garth's Avatar

    I have reported this issue twice over the last 3 years. But has it been fixed - no it hasn't. The other day I was wanting to find the value of an investment in 2001, where I make a regular monthly investment and while the value was correct, the cost included all additional investments made between 2001 and 2020! So cost was so much greater than the value, when value should exceed cost.

  11. 11 Posted by dwg on 27 May, 2020 10:51 PM

    dwg's Avatar

    Sadly Investments and Investment reports seem to have been overlooked in Moneydance for quite some time. There are problems with quite a number of the reports and the capability in handling invesment transactions could do with expansion.

    The issues have been raised on many occasions, but more noise about the inadequacies in this area never hurts.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? 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