PDA

View Full Version : Point me in the right direction


hypomojo
09-27-2006, 10:34 AM
I want to build an application that will suck down end of day financial trading data, keep the historical data, and calculate certain statistics. I'm doing this mainly because I'm too cheap to pay money for other charting software and to learn to use MySQL.

First, I need to populate the database and I'm wondering if, with a large CSV file of (for example) all of the date, open, high, low, close and volume information for all symbols on the NASDAQ (for a single day), is there a way to have MYSQL create a table per symbol and;

Next, populate each symbol/table with the historical information from something Yahoo!Finance (I have an Excel Marco that will do this sort of)?

Then, each day at 5:00 grab the latest daily end of day file and update the database (each symbols table)?

From this data I will then want to do a bunch of other things but this is a good place to start. Thanks in advance.

guelphdad
09-27-2006, 03:45 PM
you would have to run a cron to bring the data into your tables on a regular basis.

BUT NO do not create a separate table for each symbol.

Create a single table for the symbols

idfield,
symbol,
companyname

and add a new row for each stock symbol.

then your main table

stocksymbol
date
open
close
volume

you don't need historical columns because you would query your database and get the historic high/low with each date they occurred on. make sure you index your stocksymbol and date columns in that table.

you can use LOAD DATA INFILE to draw your data into your mysql table from a csv file. once you know that is working correctly you can set up a cron job to populate your table.