Wednesday, July 11, 2012

Historical Minute-by-Minute Stock Prices in MATLAB

This is an extension of my first post on this blog. My first post went over how to gather the minute to minute stock price data from Google Finance using Mathematica. Using the same general programming structure, I've created a function to do this in MATLAB. 

The IntraDayStockData function can be obtained hereThis function takes necessary inputs of a stock symbol and the name of the exchange the stock is traded in. This function also takes optional inputs of quote frequency (in seconds) and number of previous trading days. By default, the optional inputs are set for 1 minute quote intervals and 15 previous trading days. The output of this function are the time, the time in string format, trade volume, highest prices, lowest prices, and closing prices. Here is a quick example for getting the minute by minute quotes of the latest trading day (today) for JP Morgan Chase:

jpm = IntraDayStockData('JPM','NYSE','60','1d'); plot(jpm.date,jpm.close,'b-'); hold on; plot(jpm.date,jpm.high,'r-'); hold on; plot(jpm.date,jpm.low,'g-'); datetick('x',16);

4 comments:

  1. Hi,

    Can this be done in python?

    ReplyDelete
    Replies
    1. Yes, everything can be done in python! I just created a post to answer you question, check it out.

      http://nighttimecuriosities.blogspot.com/2012/08/historical-intraday-stock-price-data.html

      Delete
  2. I touch really precise version these articles I stingy there are writers that can create moral stuff.
    home finance software

    ReplyDelete
  3. thank you so much Miguel !! excellentissimo work!
    Jeff

    ReplyDelete