# Investments

This chapter explains how to manage your investments with GnuCash. Most people have a investment plan, whether its just putting money into a CD account, investing through a company sponsored plan at your workplace or buying and selling stocks and bonds through a brokerage. GnuCash gives you tools to help you manage these investments such as the Price Editor which allows you to record changes in the prices of stocks you own.

## Setting Up Accounts

To setup investment accounts in GnuCash you can either use any of the predefined categories or setup your own. The minimum you need to do to track investments in GnuCash is to setup an account for your brokerage firm or trading account and to add shares to it with a price per share and the transfer account that is paying for the investment listed in the transfer box. GnuCash will automatically calculate the value of the shares and show at the top of the register both the number of shares you own and their current value.

The following is a somewhat more complicated example of setting up GnuCash to track your investments which has the advantage that it groups each different investment under the brokerage that deals with the investments. This way it is easier to compare the statements you get from your brokerage with the accounts you have in GnuCash and spot where GnuCash differs from the statement.

    - Assets
       - Investments
          - Brokerage Accounts
             - I*Trade
                - Stocks
                   - ACME Corp
                - Money Market Funds
                   - I*Trade Municipal Fund
                - Cash
             - My Stockbroker
                - Money Market Funds
                   - Active Assets Fund
                - Government Securities
                   - Treas Bond xxx
                   - Treas Note yyy
                - Mutual Funds
                   - Fund A
                   - Fund B
                - Cash
    - Income
       - Investments
          - Brokerage Accounts
             - Capital Gains
                - I*Trade
                - My Stockbroker
             - Dividends
                - I*Trade
                   - Taxable
                   - Non-taxable
                - My Stockbroker
                   - Taxable
                   - Non-taxable
             - Interest Income
                - I*Trade
                   - Taxable
                   - Non-taxable
                - My Stockbroker
                   - Taxable
                   - Non-taxable
    - Expense
       - Investment Expenses
          - Commissions
             - I*Trade
             - My Stockbroker
          - Management Fees
             - I*Trade
             - My Stockbroker

## Creating a Portfolio for Your Current Holdings

If you used the template account setup back in Chapter's 2 & 3, you will see the investment accounts in two places under the Assets category. You can use this as a portfolio for your investments or if you wish, create your own by creating a new sub-account under Assets.

In order to receive online price quotes for your stocks you will need to setup the Perl module Finance::Quote. This is done by opening a root terminal session and typing in 'update-finance-quote' (without the quote marks). This will launch a Perl CPAN update session which goes out onto the internet in order to install the above module onto your system. If you feel uncomfortable about doing this please either email the gnucash-user mailing list (gnucash-user@gnucash.org) asking for help or come to the gnucash irc channel on irc.gnome.org. You can also leave out this step and manually update your stock prices.

You should now have at least one stock account under the Assets category. Open the Assets category by clicking on the '+', then select the Investments category: insert investaccts.png

Go to the menu and select: Account Open Subaccounts Here you see the Portfolio view. This gives you an overview of your stock portfolio including the number of shares bought and sold.

Go back to the Account list. If you open the Brokerage Account and Retirement items you will see a list of four template investment accounts. You can either use these to record your investment transactions or create new ones.

To create new investment accounts, click on the New button. You should now see the New Account dialog.

## Buying New Investments

Now that you have setup accounts you can enter in your stocks. If you open the account register you will see it looks similar to other account registers but instead of deposit and withdrawal columns it has columns to enter share amounts and their prices.

1. Start off by filling in the Date and Description fields.

2. Choose a transfer account to indicate which account was used to pay for buying the stock.

3. Fill in the number of shares purchased in the Shares column and the price paid for the shares in the Price column.

4. Enter the total cost of the transaction in the Buy column and then tab or click the Enter button to finish the transaction. insert buytrans.png

## Selling Investments

Entering an investment you are selling is done in the same way as buying one except the total cost of the transaction is entered in the Sell column and the Shares column is entered as a negative amount. insert selltrans.png

## Recording Dividends and Interest (How-To)

## Recording Stock Splits and Mergers (How-To)

## Recording Employee Stock Plans (Discussion)

### Stock Purchase Plans (How-To)

### Stock Options (How-To)

## Managing your Portfolio (Discussion)

### Portfolio View

### Updating Prices (How-To)

### Measuring Capital Gains (Discussion)

## Reconciling with the Brokerage Statement (How-To)

## Putting It All Together