MATLAB: How to use Excel Link 2.4 (R2006b) and Datafeed Toolbox 1.9 (R2006b) to pull financial data into Excel and analyze it

Spreadsheet Link

I would like to use Excel Link and Datafeed Toolbox to pull financial data into Excel and analyze it.

Best Answer

This example takes a request from Excel, uses MATLAB and Datafeed Toolbox to retrieve financial data and analyze it.
This worksheet uses the free Yahoo data feed for convenience. This could be easily changed to Bloomberg or another data feed supported by Datafeed Toolbox. For more information on the data fields available from each feed, consult the Datafeed Toolbox documentation.
Note: This example uses the Financial Toolbox function M2XDATE for date conversions. If the Financial Toolbox is not available, you can instead convert the dates manually as shown in the Excel Link documentation.
1. Install and configure Excel Link as shown in the documentation.
2. Download and open the attached yahoo_closing.xls. Enable Macros when prompted by Excel.
3. Note the security name in cell B1. You can change which security is retrieved by editing this cell.
4. Select Tools=>Macros=>Macros, select "get_closing", and select Run.
5. Observe the MATLAB plot and data returned in columns A, B, and C starting in row 5.
When you have finished the example, close the figure window.