From the stock exchange straight to MATLAB

Many creative and interested MATLAB files are posted on MATLAB Central. This week, I knew one extremely useful for those who use MATLAB to handle mathematical models for analizing stock quotes behavior and forecasting: Historical Stock Data downloader posted by Josiah Renfree. It makes possible to download stock data from Yahoo! Finance website straight to MATLAB workspace by a simple command line.

For example:

stock = hist_stock_data(’01012007′, ’08022008′, ‘PBR’);

Returns date, open, high, low, close, volume, and adjusted close price adjusted for dividends and splits of Petrobras ticker on NYSE between the dates given.

It’s also possible to retrieve multiple ticker information at once, and even to read a file with a list of symbols desired. Yahoo! Finance provides data from other Stock Exchanges than NYSE: NASDAQ, Bovespa, London Stock Exchange and others.

To make my own analysis – before using it – I used to go to financial websites, copy the historical data, paste in a spreadsheet and only than export to MATLAB variables. Because of this hard work, the mathematical models were only fed by a few selected tickers. But now, I can scan the whole spectrum of stocks and select the best ones based on my criteria. It really makes the analysis much easier and more comprehensive.

About these ads

2 responses to “From the stock exchange straight to MATLAB

  1. Can you connect to Dhaka Stock Exchange

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s