En cours

PHP script to update MySQL DB

Hi all,

We are looking to write a PHP script that updates a MySQL database of stock prices every night (cron job).

Your job would be to write and test the script.

The script is easy and fast to write for someone with PHP and MySQL experience.

Script description

The goal of the script is to maintain a database of stock prices. The script updates the database with new prices (open, high, low, close and dividend) from Yahoo Finance, every night (cron job).

The list of stock symbols to update is in one table of the database. The list will change overtime (more symbols will be added) therefore the script should read the list of symbols every time it runs. For every new symbol, the script will need to add tables in the database. And then, for every symbol in the list, the script will download latest data from Yahoo Finance, parse the data and insert it into the database.

Warning: One symbol is not available from Yahoo Finance. That symbol will need a different parser.

Language

The script should be in PHP

Variables

The following information should be variables (so that modifying them is easy):

-DB username

-DB password

-DB URL

-DB name

Database structure

-One table containing the list of stocks in the database. Columns are [id, stock symbol (string), name (string)]

This table will be updated manually when more symbols are added. That table should NOT be updated by the script.

-One table containing prices for the current day. Columns are [id, current day (date), stock symbol (string), open(double), high(double), low(double), close(double), dividend(double)]

This table is used to cache latest daily data. That table will be updated by the script.

-One table containing prices for the current month. Columns are [id, current month (date), stock symbol (string), open(double), high(double), low(double), close(double), dividend(double)]

This table is used to cache latest monthly data. That table will be updated by the script.

-One table for each stock symbol for daily data. These tables contains all daily prices for the whole history. Columns are [id, date (date), stock symbol (string), open(double), high(double), low(double), close(double), dividend(double)]

That table will be updated by the script.

-One table for each stock symbol for monthly data. These tables contains all monthly prices for the whole history. Columns are [id, date (date), stock symbol (string), open(double), high(double), low(double), close(double), dividend(double)]

That table will be updated by the script.

In total there are 4 tables + 2 tables for each stock symbol.

Script pseudocode

%Get list of stock symbols from database

For each symbol

If the symbol is new

%Create daily table for the new symbol

%Create daily table for the new symbol

End if

%Get & parse daily data from yahoo finance (We will provide the URL)

%Get & parse monthly data from yahoo finance (We will provide the URL)

%Get date of latest data in the database

%Insert missing data in the daily symbol table

%Insert missing data in the monthly symbol table

%Update current price for the symbol in the daily table

%Update current price for the symbol in the monthly table

End for each

Additional

-You need to make sure the script will still work if it does not run everyday. If for example there is a gap of one week in the data, the scrip should fill the whole week next time it runs.

-You need to ensure consistency in the data: either all symbols are updated to a specific date or none of them. If some symbols are not updated fully, the scrip should give an error.

Deliverable

-PHP script source

-MySQL database filled with price data up to the end of the project.

Do not hesitate to ask if you have questions.

Thank you

Compétences : MySQL, PHP

Voir plus : script update mysql tables, script update database mysql, yahoo-finance, week end update, this day in history database, tables in data structure, string in data structure, string data structure, night fill job, night-fill, night fill, mysql db, php symbol, download mysql, write php and mysql, update mysql, stock update, Pseudocode, php script create table, parse a string, mysql test, error in php script, mysql php yahoo stock price database, source php script, parse error parse error

Concernant l'employeur :
( 18 commentaires ) zurich, Switzerland

N° du projet : #2354511

Décerné à :

rsdsoftsl

I'm data scrapping expert and done similar projects in the past (stock prices scrapping). Please check PM.

180 $ USD en 1 jour
(193 Commentaires)
7.0

16 freelance font une offre moyenne de $178 pour ce travail

ProgPro117

Ready to start now! please check pmb

400 $ USD en 10 jours
(29 Commentaires)
5.8
sonarkaushik

Sir, I can do the project. Refer PMB. with regards

180 $ USD en 7 jours
(30 Commentaires)
5.3
ETNASoftware

Hello, Our developers have extensive experience in development of financial software and databases. Some examples of our work: [url removed, login to view] We would be glad to help you with this project. Please Plus

30 $ USD en 1 jour
(1 Commentaire)
5.0
jewelhuq

Yes I can do it. Just tell me from which site i should grab data.

50 $ USD en 2 jours
(17 Commentaires)
4.5
mkhall

I'm a Canadian PHP developer and this sounds like a very straightforward project. Please see my PM for full details.

200 $ USD en 7 jours
(10 Commentaires)
4.4
kovach

Ready to START!

200 $ USD en 3 jours
(7 Commentaires)
4.3
jasonbourne501

Dear Sir, I am highly interested. I have already done this task in another project. Please check pmb

200 $ USD en 5 jours
(10 Commentaires)
4.3
mukhan88

I have done projects on php and mysql and i m intrested to complete this

200 $ USD en 3 jours
(5 Commentaires)
3.8
stephanosl

Hello sir. I have a large experience on parsing projects.

200 $ USD en 5 jours
(17 Commentaires)
3.6
samic

Yes I understand what you and I am ready to work on it.

200 $ USD en 5 jours
(2 Commentaires)
1.6
plesko

Hi, I'm working with such a same kind of stuff... Thanks :)

200 $ USD en 6 jours
(0 Commentaires)
0.0
calinilierusu

I understood the requirements, I have the PHP amd MySQL required skills and I can deliver it in 5 days or less.

100 $ USD en 5 jours
(0 Commentaires)
0.0
Dataengineer

I have developed many cms based websites and custom portals in php. I have also developed my own custom cms and developed an email marketing application complete from start to end. Other than these, I have developed ML Plus

250 $ USD en 5 jours
(0 Commentaires)
0.0
djfdeu

see pmb...

150 $ USD en 1 jour
(0 Commentaires)
0.0
waylitte

Let me know when we can start.

100 $ USD en 1 jour
(0 Commentaires)
0.0