The value of a commodity, such as a stock, must be explicitly set. The stock accounts track the quantity of stocks you own, but the value of the stock is stored in the Price Editor. The values set in the Price Editor can be updated manually or automatically.
To use the Price Editor to track a stock value, you must initially insert the stock. To do so, open the Price Editor ( → ) and click on button. The first time a Commodity/Stock is entered this window will be blank except for the control buttons on the bottom. Select the appropriate Commodity you want to insert into the Price Editor. At this point, you can input the price of the commodity manually. There are 6 fields in the New Commodity window:
The exchange market where the security/commodity is traded (in this example NASDAQ)
The name of the commodity, must be chosen from thelist
The currency in which the Price is expressed.
Date that the price is valid
One of: Bid
(the market buying price), Ask (the market
selling price), Last (the last transaction
price), Net Asset Value (mutual fund price per
share), or Unknown. Stocks and currencies will
usually give their quotes as one of bid, ask or last. Mutual funds
are often given as net asset value. For other commodities, simply
choose Unknown. This option is for informational purposes only, it
is not used by
The price of one unit of this commodity.
As an example of adding the AMZN commodity to the price editor, with an initial value of $40.50 per share.
Click Price Editor, you will not have to do it again, even if you use the same commodity in another account.when finished. Once you have performed this initial placement of the commodity into the
If you have online retrieval of quotes activated (see Section 9.6.3, “Configuring for Automatic Retrieval of Quotes”), you can initialize a commodity without manually making an entry. When you initially add the security in the Security Editor, check and save the security. Then, in the Price Editor, click , and the new security will be inserted into the price list with the retrieved price.
If the value of the commodity (stock) changes, you can adjust the value by entering the Price Editor, selecting the commodity, clicking on and entering the new price.
If you have more than a couple of commodities, you will tire of
having to update their prices constantly.
GnuCash has the ability to
automatically download the most recent price for your commodities using
the Internet. This is accomplished through the
Finance::Quote, which must be installed in order to activate this
To determine if the
Finance::Quote is already
installed on your system, type perldoc Finance::Quote in
a terminal window and check to see if there is any documentation
available. If you see the documentation, then the module is installed,
if you do not see the documentation, then it has not been
Run Install Online Price
Retrieval which can be found in the
GnuCash “Start” menu
Mac OS X: You need to
have XCode installed. XCode is an optional item from your OS X
distribution DVD. Run the Update
Finance Quote app in the
GnuCash dmg. You can run it from the
dmg or copy it to the same folder to which you copied
GnuCash. It will open a Terminal
window and run a script for you which will ask lots of
questions. Accept the default for each unless you know what
Close any running
Locate the folder where
is installed by searching for
Change to that directory, open a root shell
Run the command gnc-fq-update
This will launch a
Perl CPAN update session that will go out
onto the internet and install the
Finance::Quote module on
your system. The gnc-fq-update program is interactive,
however, with most systems you should be able to answer
“no” to the first question: “Are you ready
for manual configuration? [yes]” and the update will
continue automatically from that point.
After installation is complete, you should run the “gnc-fq-dump”
test program, in the same directory, distributed with
GnuCash to test
Finance::Quote is installed and working properly.
If you feel uncomfortable about performing any of these steps,
please either email the
Finance::Quote installed and functioning correctly, you
must configure your
GnuCash securities to use this feature to
obtain updated price information automatically. Whether creating new securities or modifying securities
that have already been setup, use the → , to edit the
security and check the Get Online Quotes box. You will
now be able to modify the radio buttons for Type of quote source, the pull-down menus
to specify the specific source(s) and The timezone for these
quotes. When finished editing, Close the Security Editor to return to
the Price Editor and click on the
button to update your stock prices on the Internet.
The command gnucash --add-price-quotes $HOME/gnucash-filename
can be used to fetch the current prices of your stocks. The file specified
$HOME/gnucash-filename will depend on the name and location of your
This can be determined by the name displayed in the top frame of the
before the “-”. The file name can also be found under
in the recently opened file list; the first item, numbered 1, is the name of the currently
This can be automated by creating a
crontab entry. For example,
to update your file every Friday evening (16:00) after the relevant exchange
markets close (modify the time accordingly for your time zone), you could add
the following to your personal
0 16 * * 5 gnucash --add-price-quotes $HOME/gnucash-filename > /dev/null 2>&1
Remember that Mutual Fund “prices” are really “Net Asset Value” and require several hours after the exchange closes before being available. If NAVs are downloaded before the current days NAVs are determined, yesterday’s NAVs are retrieved.
The main account window, by default, only shows the quantity of each commodity that you own, under the column heading Total. In the case of stocks, this commodity is the number of shares. Often, however, you will want to see the value of your stocks expressed in terms of some monetary unit. This is easily accomplished by entering the main window, selecting the Accounts tab, by clicking on the Titlebar button (the small down pointing arrow on the right side of the main account window titles bar), and selecting the option to display the account total field “Total (USD)”. You will see a new column in the main window entitled Total (USD) that will express the value of all commodities in the report currency.
GnuCash Asset reports have options to set/modify a number of parameters for the report. The
Options windows is displayed by selecting the report tab then clicking on either the
icon in the Menubar or selecting → .
The General tab in the
resulting window contains various parameters for the report. One of these is “Price Source” which of offers
three alternatives to determine stock prices in reports:
In the example below, the report is a customization of the Average Balance report in the Assets & Liabilities reports submenu.
Weighted Average - gives you a graph of the weighted price of all transactions. It will not take into account prices defined in the price editor.
Most recent - displays the changing value of your stocks based solely on the most recent price available from the price editor. The price figuring in your stock transactions is not considered.
Nearest in time - the graph is exclusively based on the prices available from the price editor. The value of your stock at each step and point in time is calculated based on the nearest available price in the price editor.