[EMAIL PROTECTED] (Linas Vepstas) writes:

> > I wonder if other countries have other creative solutions to this situation.
> 
> Someone would have to write the code ... although first step would be
> submit a patch to the src/doc directory that clearly explained how it works.  
> e.g. what if you buy at two different prices days apart?  years apart?
> how about buy, buy, sell some, buy more ...  then what's the cost basis?

Are you actually asking or just giving examples of questions that have to be
addressed?

In the Canadian case as I understand it (this should probably all be
double-checked before actually writing code):

When you buy you average the existing average cost and your new purchase cost
weighted by the size of the existing holdings and the new purchase. When you
sell you simply reduce the size of the holding, the capital gain is the
difference between the average cost and the sell price.

So for example you could buy 1 share at $1.00 (1 x $1.00), then buy 1 share at
$2.00 (2 x $1.50), then buy 1 share at $3 (3 x $2.00), then sell 1 share at $1
(2 x $2.00 with $1 capital loss). Then buy 1 share at $5 (3 x $3.00) then sell
all 3 at $5 ($6 capital gain).

I could probably write this code sometime, but right now I'm kind of busy so I
probably wouldn't be able to spend the time it would take to get familiar with
the codebase.

-- 
greg

_______________________________________________
gnucash-devel mailing list
[EMAIL PROTECTED]
http://www.gnucash.org/cgi-bin/mailman/listinfo/gnucash-devel

Reply via email to