How to Integrate Live BSE and NSE Stock Prices into Excel
Accurately tracking live stock prices from BSE (Bhavan#39;s Stock Exchange) and NSE (National Stock Exchange) is crucial for traders and financial analysts. Excel provides several methods to achieve this, ranging from specialized tools to built-in features. Below, we explore various methods including MarketXLS, Yahoo Finance API, VBA scripts, Google Finance API, and broker APIs.
1. MarketXLS
MarketXLS is a powerful tool that directly provides live stock data and options data from NSE into Excel. It is particularly useful for serious option traders needing real-time prices. Here are the steps to integrate live stock prices using MarketXLS:
Installation: Install MarketXLS if it is not already installed in your Excel environment. Login: Log in to your MarketXLS account. Using Formulas: Use specific MarketXLS formulas such as ZeroDhaLast and AngelOneLast. These formulas extract and display real-time stock prices directly in your Excel worksheet, similar to what you see on trading platforms.MarketXLS supports a wide range of live market data, including prices, volumes, and other financial metrics for Indian stocks. While it is a paid service, its comprehensive features make it an excellent choice for traders who need real-time data.
2. Yahoo Finance API Alternative
Yahoo Finance, although limited in its API, is still useful for pulling live stock data for Indian stocks. You can use the WEBSERVICE function in Excel to achieve this. Here is an example of how to do it:
In a cell, enter the following formula: WEBSERVICE("") Replace this formula with the correct stock symbol, for example, RELIANCE.NS for Reliance Industries Limited.Using Yahoo Finance API can be effective, but it has limitations. It may not provide real-time data and may have delays in fetching the stock prices.
3. NSE/BSE Websites Using VBA
Another approach is to use Excel’s built-in capabilities to fetch live data from NSE or BSE websites using VBA (Visual Basic for Applications) scripts or Power Query.
For Power Query: Go to Data Get Data From Web. Enter the URL for the specific stock data from NSE or BSE, for example, the NSE stock page URL. Import the live data into your worksheet.Using VBA can be a more flexible option for those comfortable with scripting, as it allows customizing the data retrieval process and handling live updates.
4. Google Finance API in Excel
Despite Google Finance API limitations, it can still be used to fetch NSE data for Google Sheets, which can then be exported to Excel. Here are the steps:
In Google Sheets, use: GOOGLEFINANCE("NSE:fincorp") Save the Google Sheet. Export the sheet data to Excel.Using Google Finance API can be effective, especially for quick data retrieval, but it is not as flexible or comprehensive as some of the other methods mentioned.
5. Broker APIs (Zerodha, Upstox, etc.)
Brokers such as Zerodha and Upstox offer APIs that provide real-time data. Integrating these APIs with Excel using VBA or Python scripts can be a powerful way to get live stock prices. Below is an example using Zerodha Kite API:
Steps:
Get API access from your broker. Write a VBA/Python script to connect to the API and fetch live prices. Update the data periodically using Excel’s scheduling functionality.This method offers real-time data and is highly customizable, making it suitable for professional traders and analysts.
6. Manual Updates with Excel Stock Data Type
A simple and straightforward method is to use Excel’s built-in Stock Data Type feature. Here are the steps:
Select the ticker symbols you want live data for in an Excel column. Go to the Data tab. Choose Stocks in the Data Types group. Excel will automatically convert these into rich data types and allow you to pull data like the price, volume, etc.While this method is manual and may not provide real-time data, it is an easy way to get historical data and can be updated manually as needed.
Conclusion: Depending on your requirements, choose the method that best suits you. For real-time data, tools like MarketXLS and integrating broker APIs are highly recommended. For delayed data or more flexibility, VBA scripts, Power Query, or manual updates might be more suitable.