Subscribe Bookmark RSS Feed

Stock data using JMP

gregorysnelson

Community Trekker

Joined:

Jun 23, 2011

Hi,

I'm trying to learn JMP and the scripting language and to give myself some homework. I thot it might be interesting to download some data. So I have chosen Yahoo finance stock data so I keep up with my stocks.

The first challenge is to get the data. I've found the following url that gives me what I want (the next step will be to iterate over a series of stocks that i am interested in - more later on that).

http://ichart.finance.yahoo.com/table.csv?s=YHOO&a=00&b=1&c=1871&d=11&e=31&f=2009&g=d&ignore=.csv

I'm guessing that the Open From Internet wont work as this file returned is a csv.

Is there a way to grab the CSV automatically from the HTTP response and convert that into a JMP data table?

thanks in advance!

-greg
6 REPLIES
Well you can open a CSV in JMP and it will create a Data Table. You can just use the Open command:

dt = Open(CSV File);
gregorysnelson

Community Trekker

Joined:

Jun 23, 2011

I want to avoid having to download each file separately through the web browser. I would like to automate the retrieval of the stock prices.

Can the Open function open a file with an HTTP:// interface versus having it be file based?

-greg
Yes open a new script, paste this command in it and then run it.

dt = open( "http://ichart.finance.yahoo.com/table.csv?s=YHOO&a=00&b=1&c=1871&d=11&e=31&f=2009&g=d&ignore=.csv" );
gregorysnelson

Community Trekker

Joined:

Jun 23, 2011

excellent! thank you.
afterword

Community Trekker

Joined:

Jun 23, 2011

Hey - great trick! You could do quite a bit of portfolio analysis by opening and joining tables for any stocks you hold.

Now, if anyone can write me a script that chooses the stocks that are going to rise, let me know.
gregorysnelson

Community Trekker

Joined:

Jun 23, 2011

i'll JMP right on that! ;-)