PATCH: Advanced portfolio report revisions

Segundo Bob SegundoBob at
Sun Dec 9 00:18:04 EST 2007


	Thanks for the hint about FIFO, FILO.  We had overlooked these options.

	We are migrating from Microsoft-Money 2005.  For this mutual fund in Microsoft-Money we used FIFO.  So we can happily report that your 2007-12-03 version with the FIFO option selected agrees with Microsoft-Money--but the column definitions differ slightly between the two reports.
The Advanced Portfolio Report values are:

Basis			$86,311.17
Value			$84,476.55
Money In 		$83,532.00
Money Out		$47,500.00
Realized Gain		$50,279.17 
Unrealized Gain		$(1,834.62)
Total Gain		$48,444.55 
Total Return		58.00%
Brokerage Fees		$0.00
The Microsoft-Money Report values are:

Buys 			$132,465.32
Sells			$47,500.00
Income			$48,933,32
value on 12/6/2007	$84,476.55
Cost Basis		$86,311.17
Realized Gain/Loss	$1,345.85
Return for Period	$48,444.55
% Rate of Return	36.57
Annual % Return		5.46
The GnuCash "Basis" equals the Microsoft-Money "Cost Basis."
The GnuCash "Value" equals the Microsoft-Money "value on 12/6/2007."
The GnuCash "Money Out" equals the Microsoft-Money "Sells".
The GnuCash "Money In" equals the Microsoft-Money "Buys" minus "Income."
The GnuCash "Total Gain" equals the Microsoft-Money "Return for Period."
The GnuCash "Realized Gain" equals the Microsoft-Money "Income" plus "Realized Gain/Loss".

The GnuCash reports "Total Return."
Microsoft-Money reports "% Rate of Return" and "Annual % Return."

The GnuCash "Total Return" seems to be "Total Gain" divided by "Money In."  This seems reasonably meaningful, but not very useful for comparing investments.

We believe that the Microsoft-Money "% Rate of Return" is "Return for period" divided by "Buys".  This seems to be a not very meaningful number.
We believe, but we are not sure, that the Microsoft-Money "Annual % Return" is the Internal Rate of Return (IRR).  See We believe that the IRR is the "best" measure of return, because it allows any two investments to be meaningfully compared..  The calculation is non-trivial.  I recommend "Financial Calculation Programs for Linux" by James Shapiro at  He gives C, Java, and Perl programs for calculating IRR.

We find all the columns in the GnuCash report useful and we think it would be worthwhile to add columns for "income" and "realized gain."

Brenda & Segundo Bob
SegundoBob at

Andrew Sackville-West wrote:
> On Thu, Dec 06, 2007 at 09:37:50AM -0800, Segundo Bob wrote:
>> Andrew Sackville-West and Morrison J. Chang,
>> Thanks for working on advanced-portfolio.scm.  You have greatly improved this report for our data.  But the report still handles one of our accounts incorrectly.  The attached TestFile contains only the account data that the report handles incorrectly.  TestFile does NOT contain any account numbers or other private data.  The release 2.2.1 advanced-porfolio report for this account puts numbers in all the columns (wrong numbers).  Andrew's versions of 2007-11-29 and 2007-12-03; and Morrison's version of 2007-11-28 are all the same for this account.  They leave four columns blank--but all the non-blank, non-zero columns are correct.
>> We hope you find this test case useful, but we may be missing something obvious.  My wife and I began trying GnuCash less than a month ago.
> It's extremely useful, thanks! You've got a goodly chunk of data
> here. What we're seeing is an overflow condition because the average
> basis calculation is un-rounded. So it just kind of gets out of
> control. Not that if you change the basis method to FIFO or FILO, you
> get numbers in every column :). Can you determine the correctness of
> the results in that case? 
> Meanwhile I'll work some rounding into those calculations to keep
> them from spiraling so out of control.
> Thanks again for this Bob, it's very helpful.
> A
> ------------------------------------------------------------------------
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at

More information about the gnucash-devel mailing list