[Patch] reworked advanced-portfolio.scm

Andrew Sackville-West andrew at farwestbilliards.com
Tue Feb 21 18:54:59 EST 2006


Alright gang, so here's the sit. on the advanced-portfolio report:

I'm rewriting it so that it tracks two sets of prices in parallel buy checking the pricedb and the txn's themselves. Then report back the numbers based on whichever of these two prices is "closer" to the report date. The idea being that it will provide the latest price information we can find relative to the date of the report.

Once that's working, I'll look into currency exchanges. but that's another story. 

As it stands now, it will report out:

total money in (the total amount of money flowing into the stock)
total money out (the total money out of the stock)
unit (total number of shares held at report date)
price (with a flag as to whether its a pricedb entry or a txn price)
value (price*unit)
gain (see below)
return (hmmm... below)

gain: what do we want to see here? value - money in? that's not right, what if some stock was sold... okay, value -(money in-money out)? not right either. It should be value -(on-hand-lots-money-in) where on-hand-lots-money is the purchase price of the lots still held in account. That's complicated at best. Any ideas for what gain should be? 

A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20060221/e88f3aee/attachment.bin


More information about the gnucash-devel mailing list