NOTE: Last updated on January 6, 2022.
If you are a user of Gnucash http://www.gnucash.org, you have options to enable it to retrieve online stock quotes. It can even be set up to retrieve online mutual fund quotes for Indian Mutual funds. Gnucash is an open source, cross-platform, operating system independent, personal finance manager. It works on Linux, Windows and Mac. Explained below is an example of how you can enable it to retrieve stock quotes from on line sources and view the latest value of your stocks using it’s Advanced Portfolio report. If you want to install Gnucash on a Windows computer, see this post.
- My stock’s name is HDIL and it is listed on the National Stock Exchange (NSE) in India. The quotes for it are available for retrieval on Yahoo as JSON. The stock is also listed on the Bombay Stock Exchange (BSE) in India, but I will only fetch it from the NSE.
- Start Gnucash and click on the menu options: Tools -> Security Editor.
You will now see the Security Editor window as in Ilustration 1.
Illustration 1: Securities
Click on the Add button to add your Security to the Securities List.
Upon clicking the Add button in Illustration 1, you will see the dialog as in Illustration 2.
Illustration 2: Security Information
In the dialog box as shown in Illustration 2, you should enter the following information:
This is the full name of the company whose stock you own.
Enter the code of the stock. You can find out this code from the Yahoo Finance web site at this link https://finance.yahoo.com. I got the code for the HDIL stock on the NSE from here https://finance.yahoo.com/quote/HDIL.NS?p=HDIL.NS&.tsrc=fin-srch. The symbol for HDIL is HDIL.NS as listed on the page. You can also look up for HDIL.BO, which is the Bombay Stock Exchange quote. Enter that in this box.
This should be NS or BO. I kept it as NS. If you do not see a type for NSE in the drop down, you can directly type it in here, also.
ISIN, CUSIP or other code:
You can leave this blank.
This will be 1/1 for HDIL. Sometimes, you can trade fractional amounts, and you should enter 1/<fraction> depending up to how many decimals you want for fractions. Normally, fractions default to 1/1000.
Quote Source Information:
Tick the box Get Online Quotes.
Type of Quote Source:
This for HDIL will be Single and within that Yahoo as JSON.
Now click the OK button to add the entry.
Important to note that in the newer versions of Gnucash, the Security/Currency cannot be edited in “Edit Account” screen, if there are transactions and another stock source was used. The changes in previous step should suffice.
In the previous step, we set up the Security in the Security Editor. Now we have to add Edit the Stock Account and point to it. Go the the main account display of Gnucash and select the HDIL Stock. Select Edit and then Edit Account from the Gnucash main menu. You will see a screen similar to Illustration 3 below:
Illustration 3: Edit Account
Enter the following information for the fields as shown in Illustration 3 above.
Click on the Select… button next to the Security/Currency: field. Upon clicking select, you can choose HDIL.NS from the list that it shows. This field actually picks up all the values from the Securities dialog that we entered in Steps a. and b. above.
Now, click the OK button to save the changes. Move to step d. to test your settings.
This step shows you how to retrieve the latest online prices for the stock. Select Tools->Price Editor from the Gnucash main menu. This will show a dialog as in Illustration 4 below:
Illustration 4: Price Editor – get Online Stock Quotes
Click on the Get Quotes button to fetch the online quote for the HDIL stock. Once this step is done, click the Close button and from the Gnucash main menu select Reports->Advanced Portfolio to see your current stock value.
The above steps also apply to Mutual Funds NAVs that can be retrieved from https://finance.yahoo.com. I will take HDFC Top 100 Fund – Direct Plan – Growth Option as an example.
Visit https://finance.yahoo.com and search for HDFC Top 100. From the Drop Down displayed, select HDFC Top 100 Fund – Direct Plan – Growth Option and the details of the mutual fund scheme will be displayed at in this link https://finance.yahoo.com/quote/0P0000XW91.BO?p=0P0000XW91.BO&.tsrc=fin-srch. The Stock Quote value for the scheme HDFC Top 100 Fund – Direct Plan – Growth Option that you can use in Gnucash is 0P0000XW91.BO.
Now, as illustrated for stock quotes in this post earlier using Single Quote Source of Yahoo as JSON, instead of HDIL.BO, just use 0P0000XW91.BO and Gnucash will be able to retrieve Mutual Fund NAVs.