Price Source for Mutual Fund and Stock

Andrew Sackville-West andrew at swclan.homelinux.org
Thu Mar 20 13:29:49 EDT 2008


On Thu, Mar 20, 2008 at 09:59:38AM -0400, Derek Atkins wrote:
> Hi,
> 
> "Yogesh Agrawal" <agrawaly at gmail.com> writes:
> 
> > Hi,
> >
> > I have a question regarding the price for mutual fund and stock, that show
> > up on different reports like balance sheet.
> >
> > There are three options
> > 1) Weighted Average
> > 2) Nearest in time
> > 3) Most recent
> >
> > I have two entries in the mutual fund
> >
> > 1) 117.428 unit @ 53.98       = 6338.76
> > 2) 135.725 unit @ 191.628   = 26008.77

what do you mean by "two entries"? Is that two entries in the pricedb?
or two entries in the actual account? 

> >
> > When I select Weighted average I see total of
> >
> > 253.153 unit and total amount as 29286.59
> >
> > But when I select "nearest in time" or "most recent" I see
> > total amount as 48511.20
> >
> > Yes I have two entry in the price editor one for 53.98 (dated 04/19/2004)
> > and another for 191.628 (dated 01/11/2008)
> 
> That's correct, nearest in time and most recent use pricedb entries.
> The most recent entry and the nearest in time entry are all 191.628,
> so 191.628 * 253.153 == 48511.20.  So THAT is correct.
> 
> > The question I have is how is the weighted average calculated
> > and how can I get the total amount as  32347.53 (6338.76 + 26008.77)
> 
> Honestly, I'm not sure how weighted average is computed.  It seems
> to be computing the average price as 115.687 instead of what
> you expect it to be: 127.778 but I'm afraid I don't know why.

After a quick perusal, it appears that weighted average is computed
from the splits in the account directly. It also appears to ignore the
pricedb (but I *really* didn't read carefully). So if there are
entries in the account that differ from the pricedb, that would cause
it to generate a different result. 

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


More information about the gnucash-user mailing list