Monday, April 18, 2011

Google Finance Backfill

During a 3am google search, I stumbled upon this page:

http://www.marketcalls.in/database/google-realtime-intraday-backfill-data.html

It seems that google finance keeps a 15 day minute by minute backfill of all stock quotes.  This was a great opportunity to use Mathematica to do some overly-complicated plotting at 3am.

The parameters to get the data is detailed on the site above.  For the minute by minute quote of JP Morgan for the last 15 days, the Market Calls website suggested using the following URL:

http://www.google.com/finance/getprices?q=JPM&x=NYSE&i=60&p=15d&f=d,c,h,l

The first task was to create a way to download the data for any stock of interest, which was easy enough with Mathematica.

Now the second task was a bit more complicated, since the backfill data kept time in a Unix format (counting the seconds since the birth of Unix).  The following snippet of code can convert this Unix time to a more familiar format.

Then all that is left to do, is to extract and format the price data.

Now it is time to plot!


When insomnia hits again, I may try my hand on some econometrics styled analysis with this data.  For those interested in playing with the code, you can download it here


1 comment:

  1. I have to thank you for this good site .I for sure loved every little bit of it. I have you bookmarked your web site to look at the latest stuff you put up.

    GOOG Stocks News

    ReplyDelete