Report to locate Unrealized Gains

David T. sunfish62 at yahoo.com
Wed Feb 8 07:24:57 EST 2017


David,

> On Feb 8, 2017, at 10:54 AM, David Carlson <david.carlson.417 at gmail.com> wrote:
> 
> David,
> 
> It is not all that difficult to build a spreadsheet that both calculates "net" and "gross" capital gains and separates commissions and fees even for partial lots.  It gets more interesting when different accounting procedures such as FIFO, LIFO, Average and purely selective lot matching are considered.  I think that there are probably commercial programs that do this too, and all brokerage house back rooms do that and more, since some of their clients have margin accounts, trade in derivatives etc.  How difficult would it be to put some of this into GnuCash?  In any case it won't happen in the next several months.

A spreadsheet is going to have specific spots for each of these categories of numbers, making it relatively straightforward to create calculations. Unfortunately, with GnuCash, there are no such fixed slots, and calculation must take that into account. I recognize that complexity.

> In your second paragraph you mention the value of shares that you did not sell when you do not completely close a position.  Wouldn't that depend on report settings where 'nearest in time' would (i hope) prefer a quoted price over an actual transaction price on that day?

I seem to recall seeing a change in the PriceDb recently such that only one value would be entered for a given date. If the value stored is the spurious value of the sell, I would imagine it would affect the assessed value on that date. As I said, a minor point, but one to consider.

> 
> When I mentioned residual value of comodities I was referring to the optional Accounts register columns labelled, for example, Present (USD or your default currency.  That column will not go to zero when closing a position unless the realized gain is correctly entered.  Of course, it is more difficult to know if it is correct when there are multiple lots. That is a handy thing to know.  

OK, so now I feel even more strongly that the calculations on the Balance Sheet report and Trial Balance report are counter productive. They are wrong. The example account I provided shows $0 Present (USD) in the chart of accounts—which is correct. The account includes transactions that correctly document the cost basis of the shares, the funds generated by the sale of those shares AND the capital gains on the sale. The fact that this is reflected in the Chart of Accounts only underscores the failings of these reports to calculate the correct figure. I’ll note that another user claims to have solved his problems with the Trial Balance report by downgrading to 2.6.11. I do not know whether there was some substantive change between 2.6.11 and later versions, but it bears investigation.

> In another thread about lots I see that the lot feature will not work correctly if the realized gains are in the same transaction as the sale.  The manual has for years indicated that putting the gain in the same closing transaction was the preferred procedure, and it is the only way that I do it.  I guess I will not be using lots.
> 

Treatment of capital gains in GnuCash continues to be exceedingly fragile. It is frustrating that this aspect relies on so many specific (and often counter) tactics: use one multi-split transaction, use separate transactions, don’t document your commissions and fees directly, but embed them in the sale price—is there anything else I missed?

David T.

> David C
> 



More information about the gnucash-user mailing list