Cost Basis Report with Tax Lot information?

magellan's Avatar


18 Aug, 2019 12:33 PM

I'm looking for a way to show all tax lot information for all accounts/securities.

I can review the tax lot details for each account/security in the Security Details view, but I'd like a report so I can easily export the data for all accounts/securities to excel or a pdf without having to manually capture the details for each security.

Does such a report exist?


  1. 1 Posted by magellan on 19 Aug, 2019 01:51 PM

    magellan's Avatar

    Well moneydance sure is flexible. I'm a complete python noob, but I was able to create a script that shows all open tax lots for all accounts/securities as of the current date.

    Just in case anyone else needs this, the python script is attached. Typical disclaimers apply - This is the first snippet of python code I've ever written as well as my first attempt at moneydance coding, so I really have no idea what I'm doing - Run the script at your own risk.

    The script only produces meaningful output if you have at least one security with a positive share balance and the Cost Basis set to 'Lot Matching'

    You can run the report by selecting Window->'Show MoneyBot Console', pasting the text from the attached file into the Python Snippet window, and clicking the 'Run Snippet' button.

    It's easier to read the output if you copy/paste it into excel and format the 'Available Shares' and 'Cost Basis' columns

  2. 2 Posted by magellan on 19 Aug, 2019 09:14 PM

    magellan's Avatar

    The script above was a good first effort, but further testing revealed that it doesn't handle splits correctly. This new and improved one should be better.

    I just finished verifying the information for all of the outstanding lots against what Quicken has and it checks out.

    One thing I realized in this exercise is that the MoneyDance Lot Matching window shows the split adjusted share count for each lot, but it doesn't show the adjusted price.

    So if I understand it correctly, you can't use the information shown in the Lot Matching window to compute the capital gains on the sale if you have splits. That's a bit of a problem because the Cost Basis and Capital Gains reports are a bit lacking w.r.t. specific lot id reporting.

  3. 3 Posted by magellan on 19 Aug, 2019 09:19 PM

    magellan's Avatar

    Sorry, the file above was the same as the original upload.

    Hopefully this is the correct one.

  4. 4 Posted by magellan on 21 Aug, 2019 11:54 PM

    magellan's Avatar

    Sorry for all the spam. Another version with better output formatting.

  5. System closed this discussion on 21 Nov, 2019 12:00 AM.

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

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