CHAPTER 4Working with Financial Data

4.1 Introduction

This chapter demonstrates how to import, manipulate, and visualize financial data from external sources such as FRED (economic data from the Federal Reserve Bank of St. Louis), Google, Microsoft® Excel®, Money.Net, and Yahoo! Finance.

Key concepts and functions used in this chapter include:

  • Downloading and organizing securities and economic data
  • Bringing data into MATLAB®
  • Built-in plot functions
  • Using the plot tools
  • Plotting with commands
  • Built-in financial charts

Required software: MATLAB base program; MATLAB Datafeed Toolbox™; MATLAB Financial Toolbox™

4.2 Accessing Financial Data

Examples in preceding chapters either provided data for calculation or assumed the user would enter data as needed for functions. A more likely scenario is that you need to import larger data sets into MATLAB; the data source often will depend on arrangements your employer or school have made with vendors. However, some securities and economic data are available online for no cost, and this chapter's examples will use those data sets primarily. MATLAB can work with data from multiple commercial vendors, such as Bloomberg, Money.Net, and Reuters, among others. (According to messages in the MATLAB users' forums, the software works with EOD Historical Data but I have not used that service.) The full list of vendors is available in the MATLAB Datafeed Toolbox documentation.

Admittedly, data transfers and visualization are not the most exciting ...

Get Foundations of Computational Finance with MATLAB now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.