Incorrect Capital gains report/calculation on Short trades

A Ness's Avatar

A Ness

30 Jun, 2023 04:01 PM

This seems to have been flagged before but I can't seem to find a solution to this issue.
The capital gains report shows incorrect values with a short sale trade. The Capital Gains report uses the sale/sell transaction which occurs first, recognizes it and flags it as a short sale on the report but it doesn't match up the transaction with the corresponding cover/buy.
So, the Short sale capital gain on the report after the position is covered shows a 100% gain equivalent to the original short sale amount, without deducting the cost to buy bak the position/cover.
Any fix to this?

  1. 1 Posted by A Ness on 08 Aug, 2023 08:01 AM

    A Ness's Avatar

    Is anyone looking into this?

  2. 2 Posted by A Ness on 23 Aug, 2023 07:51 PM

    A Ness's Avatar

    This has got to be the worst support service I have ever seen. No reply, no acknowlegement, just a black hole.

  3. Support Staff 3 Posted by Maddy on 24 Aug, 2023 01:25 PM

    Maddy's Avatar


    Firstly, please accept my sincere apologies for lack of response.
    I’m sorry to keep you waiting, but I’d like to run your query past the development team who may be able to provide further information.

    Maddy, Infinite Kind Support

  4. 4 Posted by A Ness on 24 Aug, 2023 02:20 PM

    A Ness's Avatar

    Thanks for your response.
    Sorry for the outburst, but I have now more than 100 short trades I cannot clear because of this reporting issue on capital gains/losses on short trades.
    Await an update, hopefully a positive resolution.

  5. System closed this discussion on 23 Nov, 2023 02:20 PM.

  6. Maddy re-opened this discussion on 17 Feb, 2024 11:07 AM

  7. 5 Posted by Stuart Beesley ... on 17 Feb, 2024 12:41 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    I’m willing to look into this (having suggested other fixes to the report recently). Can you advise how you identify the correct buy/cover to match to a short sell? Thanks.

  8. 6 Posted by lasting.snark0s on 17 Feb, 2024 04:22 PM

    lasting.snark0s's Avatar

    Hi Stuart,
    Thank you for your email.
    I’ve used Sell to Open for the initial short sale and Buy to Cover to close
    out the position.
    These give incorrect calculations, any difference between the trades not
    being calculated. I’ve tried simply Sell when I open the position and Buy
    when I close it out but this does work either.
    My only temporary work around is to invert the trades and dates of the
    trades and use Buy and Sell only (The Buy is the Buy to Cover at the date
    of the initial Sale to Open for the amount of the trade to close it out and
    the Sell is at the date of what should have been the Buy to cover for the
    amount of the opening position). This gives correct calculations but the
    dates are obviously incorrect.
    Thank you for your help.

    Andrew Ness

    On Sat, 17 Feb 2024 at 13:41, Stuart Beesley (Mr Toolbox) <
    [email blocked]>

  9. 7 Posted by Stuart Beesley ... on 17 Feb, 2024 04:35 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Sorry, I did not understand what you wrote..

    Are you using the MD Short/Cover txn types or not? Your message above implies not, and that you are just using bog std Buy/Sell?

  10. 8 Posted by lasting.snark0s on 17 Feb, 2024 05:19 PM

    lasting.snark0s's Avatar

    As I said, the standard Short/Cover give completely incorrect calculations.
    The rest of the message is what I tried to see if it corrected the problem
    (using Sell instead of Sell to open/ Buy instead of Buy to cover but that
    does not work either) and the work around that I’ve taken such that I can
    have correct capital gains/losses calculations I.e. inverting the trades
    and dates such that they look like standard Buy/Sell.
    Andrew Ness

    On Sat, Feb 17, 2024 at 5:35 PM Stuart Beesley (Mr Toolbox) <
    [email blocked]>

  11. 9 Posted by Stuart Beesley ... on 17 Feb, 2024 05:27 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Thanks... So what I was trying to ask was this...

    (not what doesn't work, but...)

    If you use the MD Short and Cover types and pretend they will work... How would you tell the computer to identify the right Cover to match to the right Short? I.e. in non computer terms, how to identify the right txns to match up for CG purposes?

  12. 10 Posted by lasting.snark0s on 17 Feb, 2024 05:46 PM

    lasting.snark0s's Avatar

    Each security is added to the portfolio with its own and distinct
    description (for example stikes, expiry dates etc will differ from one to
    the other) so there is only one (1) possible security to match.
    The system always assigns a value of zero for the Buy to Cover even though
    the entry is different, generating 100% gains (less commissions) on all
    short trades.
    Andrew Ness

    On Sat, Feb 17, 2024 at 6:28 PM Stuart Beesley (Mr Toolbox) <
    [email blocked]>

  13. 11 Posted by Stuart Beesley ... on 17 Feb, 2024 07:36 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Thanks. OK, I'll try one last time.... Is there a purely logical and 100% systemic way to identify and match covers to shorts that always works, or does it rely on things like text in descriptions that you manually enter? If the latter, then no hope. If the former, then please describe the matching logic and I'll try to help...

  14. 12 Posted by lasting.snark0s on 17 Feb, 2024 11:19 PM

    lasting.snark0s's Avatar

    I’ll also try one more time.
    The MD software matches the security transaction correctly. There’s no
    manual description. The security that needs to be covered with the Buy to
    cover is matched by the system, it just then incorrectly calculates the
    gain or loss. This is evidenced by the fact that the security disappears
    from the portfolio. If it wasn’t matched correctly, the security would
    remain in the portfolio.
    The capital gain report that is available in MD, for a reason unknown to
    me, calculates that the Buy to cover is zero even if the transaction entry
    is of a different value. This never happens for standard Buy/Sell
    transaction, just for Short/Cover transactions.
    And it happens for ALL short/Cover transactions that I have entered,
    whichever the security that is sold short and then covered, or currency of
    the transaction/security and there are many.
    Should I send you a photo of an example of the transaction entries and of
    the capital gain that the system generates? I can only do that later in the
    week, away from my desktop for the next few days.

    Andrew Ness

    On Sat, 17 Feb 2024 at 20:36, Stuart Beesley (Mr Toolbox) <
    [email blocked]>

  15. 13 Posted by Stuart Beesley ... on 18 Feb, 2024 07:01 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Thx. FYI MD does not currently match covers to shorts. It’s simply maths. One is subtracting 100 and the other adding 100. If you add up add all txns you get to zero. Hence no actual txn matching is taking place.

    For capital gains, the system needs to match. Currently it finds a short (sell) and spits out 100% gain. Then later it finds a cover(buy) and sort of ignores it (not really).

    For an enhancement to work, the system needs to know how to look forward txn by txn and identify the future cover(buy) to match to the past short(sell). Hence why I am asking for the systemic rules needed to identify a future dated cover. All I can think of is roll forward by txn/date until you find a cover with the same qty and use that. But it may not be the only rule you need. Think lot controlled where the system hunts down sells matches by lot to buys. So with shorts/covers, what is the match?


    Yes, Screenshots are always useful.

  16. 14 Posted by lasting.snark0s on 18 Feb, 2024 07:51 AM

    lasting.snark0s's Avatar

    Dear Stuart,
    I’ll get back to you mid week once I’m at my desk again and provide
    additional details.
    From what I’ve seen, the problem does not seem to reside in the transaction
    matching (the « negative » lots of the Sell to Open txn are matched with a
    resulting zero position in the portfolio) but with the values assigned by
    the system when a Buy to Cover Txn is entered. The system recognizes and
    correctly enters in the Capital Gain report the commissions paid on the Buy
    to Cover txn but not the actual value of the security txn.
    Anyways, I’ll get back with examples.
    Tks again

    Andrew Ness

    On Sun, 18 Feb 2024 at 08:01, Stuart Beesley (Mr Toolbox) <
    [email blocked]>

  17. 15 Posted by dwg on 18 Feb, 2024 08:02 AM

    dwg's Avatar

    I do not think MD has enough data to do it, it does not have the contract data, I suppose the lot data could be used but the software is not doing that.

    I do not think the implementation of Cover and Short was ever really completed in Moneydance. At the moment these actions just seem to be simple buy and sells without any matching.

  18. 16 Posted by Stuart Beesley ... on 19 Feb, 2024 07:22 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Andrew. A question.

    If you used normal sell and then buy transactions, with LOT Control turned on, and match the sell to the buy, does that work…? I’m wondering if this is essentially the way that we can ‘match’ up records. I know you cannot lot match short/covers at the moment, but we could change that so they work like sell/buys when matches.

    Thoughts? Does that work / give a correct gain?

  19. 17 Posted by lasting.snark0s on 19 Feb, 2024 07:30 PM

    lasting.snark0s's Avatar

    Hi Stuart,
    I’ll have to check if I had that ON in the past or run a test trade with
    Lot Control.
    I’ll let you know what I find, probably Wednesday or Thursday.

    Andrew Ness

    On Mon, 19 Feb 2024 at 20:22, Stuart Beesley (Mr Toolbox) <
    [email blocked]>

  20. 18 Posted by Stuart Beesley ... on 25 Feb, 2024 12:25 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    I’m pretty certain lot matching won’t work as it stands as MD only allows matching to buys in the past. It will need a special code fix.

  21. 19 Posted by lasting.snark0s on 25 Feb, 2024 01:33 PM

    lasting.snark0s's Avatar

    Noted, thank you. I haven’t had the opportunity to test it, will do soon.
    I’ll let you know in any event.

    Andrew Ness

    On Sun, 25 Feb 2024 at 13:26, Stuart Beesley (Mr Toolbox) <
    [email blocked]>

  22. 20 Posted by Stuart Beesley ... on 25 Feb, 2024 03:42 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    I’ve been thinking about this. I think that short/cover are transactions have to be matched together. As such, this means that they should not be allowed with average cost control securities. I.e. only be allowed with lot matching. Then if there was a new pop-up matching window, specifically for short/cover, then this would allow the user to match the two transactions together. Then, based on this, the cost basis, calculations, and capital gains calculations, could be adjusted to cope with the new matching rules.

    Interested to hear your thoughts?

  23. 21 Posted by Stuart Beesley ... on 25 Feb, 2024 04:11 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    .. and are covers always matched exactly 1:1 with shorts? Ie a short txn can only ever have one matching cover txn for the same number of shares, and visa versa? If so, that makes it easier.

  24. 22 Posted by lasting.snark0s on 25 Feb, 2024 04:48 PM

    lasting.snark0s's Avatar

    Playing around I have just uncovered where the problem lies.
    When the date of the Short sale predates the date of the Cover (which is
    expected unless it's a day trade), the Reporting does not give any value to
    the Buy to Cover.
    If the date of the Short Sale is the same as the Cover trade, then the
    capital Gain is correct. I don't normally Day Trade, so I never noticed
    this in the past.

    *Here are screenshots of a test trade where the Loss should be -$502*
    If the Short predates the Cover (Short on 02/23; Cover on 02/25), here are
    the results (erroneous Gain of $499 - the amount collected on the Short):

    Registry Txn

    [image: Screenshot 2024-02-25 at 17.20.06.png]

    Cap Gain Report
    [image: Screenshot 2024-02-25 at 17.22.33.png]

    If the Short is of the same date as the Cover (Short on 02/25; Cover on
    02/25), here are the results (the Cap Gain is correct):

    Registry Txn

    [image: Screenshot 2024-02-25 at 17.23.31.png]

    Cap Gain Report
    [image: Screenshot 2024-02-25 at 17.24.02.png]

    Perhaps this may be helpful in fixing this bug.
    In both cases, MD matched both trades (so Lots or Average do not appear to
    be an issue - the security can no longer be seen in the Portfolio) but MD
    does extract the amount of the Buy to Cover side when the Short predates
    the Cover. MD only correctly does this when both the Short and Cover are
    the same date.
    I'm not a programmer so can't help much in fixing this bug, but hopefully
    this info can help in getting this straightened out.
    Thanks for your continued help

    On Sun, Feb 25, 2024 at 5:12 PM Stuart Beesley (Mr Toolbox) <
    [email blocked]>

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

Recent Discussions

23 Apr, 2024 06:19 PM
23 Apr, 2024 06:08 PM
23 Apr, 2024 06:03 PM
23 Apr, 2024 06:00 PM
23 Apr, 2024 04:36 PM