Stock trades and realized gains/losses

Linas Vepstas linas@linas.org
Sat Jan 11 00:59:58 CST 2003


Hi,


> > > of adjusting transactions).  As it stands now, there is no way to
> > > logically put in an adjustment transaction, which comes from the
> > > insistence of price * quantity, rather than actual cash expenditure.  I
> > > can't record an other than temporary change in the value without
> > > recording a buy/sell, which is just...

How do you rpopose to record a change in value?

Upon further reflection after sending the previous email, I now realize
its trickier & more interesting than my earlier email suggested.   I
think I have a way, but I am not entirely happy with my solution (and so
won't propose it yet).

> I've never heard of selling and the re-buying (on paper) a stock to
> generate an unrealized gain transaction.  Do you have a reference for
> doing it that way, or was it just the most expedient thing at the time?

?? The IRS in the United States forces you to do it this way, if you
want to take a loss on your taxes.   You can't just declare the loss,
you have to sell and buy it back.  You incur some brokerage fees to do
this, hopefully not too big.


> > > To sum up:
> > > 	1) The current storage format seems OK, esp. since balances are
> > > 	   calculated dynamagically.  At most, I think an additional
> > > 	   field in Split would be useful--shareBalance or
> > > 	   purchaseBalance, depending on how this discussion goes.
> > 
> > I want to have a 'reporting currency' used in ledgers and reports.
> > Each leger/report could have a different reporting currency.
> 
> Is reporting currency equivalent to account currency?  

I'm not sure by what you mean when you say 'account currency'.
Early gnucash had an account currency, and I've been trying to 
obsolete it ever since.  I guess there might still be code that
uses it :-( I haven't looked in a long time.

> Is that just the
> currency in which the account is displayed,

The 'reporting currency' would be the currency in which the account is
displayed, and nothing more.

> or is it also measured using

We need to define what it means to 'measure'.   I wnated to get away
from the concept of 'account currency' because it made multi-currency
transactions very hard, and in some cases, ambiguous.

> > Measured in, or displayed in?  I think there's a real difference
> > here, and it affects things.
> 
> Well, when I look at the Balance column, I want to see dollars, where
> dollars is a sum of all the purchase splits 

That description matches the role of the 'reporting currency'.

> (and hopefully adjustment
> splits, sometime in the future).  

These may be a good idea, but I do not yet fully understand them.
I have an idea, but I haven't finalized a few finer points yet.

> Optimally, I'd be able to switch
> between dollars and shares, depending on my personal accounting
> preferences.  

I prefer to see both: dollars balance and share balance.   Actually,  
I would love to have a ledger that also displayed realized gains & losses 
in the dollar balance column.  But this 'display' question is separate 
from the 'how should we record it in the engine' question.

> I don't much like the idea of having to sell and then immediately re-buy
> to generate an unrealized loss/gain. That could definitely confuse
> reports!! and would need very careful manipulation re Lots, I think.  It

yes. OK.

> may be as close as we can get for the immediate future, but I really
> wish adding capabilities for an adjustment transaction could be fully
> considered (and implemented!).

OK, I'm considering.  I think I've got the rules mostly worked out, but
not all.  I think that adding a forced 'double-balance' to lots solves
one irritating conceptual problem I've always had with balancing 
multi-currency transactions.  But I sill have some mental confusion
about how to correctly balance the 'adjustment transaction'.

> > Note in earlier email, I distingusihed the transaction-balancing
> > currency C from the reporting currency R.   I think that you are
> > requesting that the ledger display a balance using C, not R, 
> > which is fine by me,  although there are again some subtle 
> > differences betweeen the two that will keep gnucash-user mailing
> > list lively for years to come.
> > 
> 
> Let me see if I understand this correctly, according to the current
> implementation for Stock accounts.  In a Stock account, the reporting
> currency R is quantity of shares.  

No, its dollars.   Shares are not a currency. 

> A Stock Transaction, OTOH, has a
> transaction currency C, which is DM, dollars, pounds, etc.. 

Yes.

Say I'm Mexican. I like to see my reports in pesos.  (R = pesos)
But I buy and sell redhat stock (account commodity is RHAT) using 
an american bank, and so balance my transactions in dollars (C == dollars).  

Thus, I'd like to view my stock account balance in shares, dollars
and pessos.  

The 'subtle' difference is this: I think the correct way to get the 
peso balance is to compute the share balance first, and then multiply
by the share price in pesos.

The correct way to show the balance in dollars is more confusing.
Should I total up the dollar values that show up in transactions?
How do I handle 'adjusting transactions'?  Should I show, or not show,
the effect of realized gains?  What do I do if I bought some shares 
in dollars, and others in euros?  How do I 'measure', in dollars,
the value of the C==euro shares?

Thus, in this example, the share-balance is 'obvious', and the
'peso-balance' is 'obvious', but the 'dollar balance' is confusing.

--linas



-- 
pub  1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <linas@linas.org>
PGP Key fingerprint = 8305 2521 6000 0B5E 8984  3F54 64A9 9A82 0104 5933



More information about the gnucash-devel mailing list