Import Historical Option Data from CSV to MySQL

Write two Perl scripts which create a database and import data from a flat CSV file to the database as specified below.

Sample input data is [here][1]. **Caution:** That file is over 21 meg, and frankly, you'll *really* only need a few Kbytes to get the idea, so feel free to abort the download quickly! (The "real" data is 3 gig.)

## Deliverables





The "create" script will drop and then create the following:

Database: Market

Table: Stocks. Primary key is Symbol.

Symbol varchar(LEN_STOCK_SYMBOL)

EarliestQuote date

LatestQuote date

Table: StockDailies. Primary key is Symbol+QuoteDate.

Symbol varchar(LEN_STOCK_SYMBOL)

QuoteDate date

Price float

Table: Options. Primary key is Underlying+Expiration+Strike100+Contract+QuoteDate.

Underlying varchar(LEN_STOCK_SYMBOL)

Expiration date

Strike100 int unsigned

Contract char

QuoteDate date

Root varchar(LEN_OP_ROOT)

Ext varchar(LEN_OP_EXT)

Last float

Bid float

Ask float

Volume float

Open float

ImpVol float

Delta float

Gamma float

The "import" script will be run in a directory which contains a set of files, each of which has a set of lines, each of which has the following pieces of data, separated by commas:

* Underlying_Symbol

* Underlying_Price

* Exchange

* Option_Root

* Option_Extension

* Contract_Type

* Expiration_Date as M/D/Y

* Quote_Date as M/D/Y followed by time and AM/PM

* Strike

* Last_Price

* Bid_Price

* Ask_Price

* Volume

* Open_Interest

* Implied_Volatility

* Delta

* Gamma

Set max_stock_symbol, max_op_root and max_op_ext each to 0.

For each line in each file in the current directory, do the following:

If the lengths of Underlying_Symbol, Option_Root, and/or Option_Extension exceeed the corresponding max's, set them appropriately.

If [url removed, login to view] = Underlying_Symbol does not exist, create it.

If [url removed, login to view] > Quote_Date, then set it.

If [url removed, login to view] < Quote_Date, then set it.

If [url removed, login to view] = Underlying_Symbol and [url removed, login to view] = Quote_Date does not exist, create it with Price = Underlying_Price. Otherwise, if it does exist and the price does not match, output a warning.

Add a row to Options using the file's line's data as follows:

Underlying = Underlying_Symbol

Expiration = Expiration_Date

Strike100 = 100 * Strike, converted to int

Contract = "C" if Contract_Type is "call", "P" if "put", else " " and output warning

QuoteDate = Quote_Date; ignore time entirely

Root = Option_Root

Ext = Option_Extension

Last, Bid, Ask, Volume, Open, ImpVol, Delta, Gamma should be set to the last eight values in the line, respectively.

(Exchange is ignored.)

After all files have been processed, output the three max's, as well as total number of files and lines processed, and excecution time.

| ![No PGP][2] | PGP is **not** required for this project. |

| ![No NDA][3] | An NDA is **not** required for this project. |

We will retain full legal rights to the code and/or data upon completion. All code and/or data is and becomes *our* intellectual property! You will *not* have any rights to the code and/or data in any fashion.

**Thank you for your consideration and for bidding through RentACoder!**

* * *Copyright ? 2005, Buyer

[notecom][4]. **All Rights Reserved.** Reproduction without permission is strictly prohibited.

* * *1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.

b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.

3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

## Platform

Linux, Perl, MySQL

Habilidades: Engenharia, Linux, MySQL, Perl, PHP, Arquitetura de software, Teste de Software

Ver mais: web gig, sample project contract agreement, sample of nda form, sample of nda, sample nda agreement form, prohibited fashion, primary data, php coder free download, one key data, nda sample form, nda form sample, nda download, nda contract sample, mysql php free source code project, mysql database free download, gig site, gig number 2, gig free, gig directory, free gig, free data input software, database constants, contract to hire agreement, working without a contract, open gamma

Acerca do Empregador:
( 137 comentários ) Wyoming, United States

ID do Projeto: #3048539

Premiar a:


See private message.

$21.25 USD em 5 dias
(7 Avaliações)

9 freelancers are bidding on average $907 for this job


See private message.

$85 USD in 5 dias
(105 Comentários)

See private message.

$59.5 USD in 5 dias
(142 Comentários)

See private message.

$85 USD in 5 dias
(45 Comentários)

See private message.

$54.4 USD in 5 dias
(17 Comentários)

See private message.

$7650 USD in 5 dias
(0 Comentários)

See private message.

$85 USD in 5 dias
(0 Comentários)

See private message.

$80.75 USD in 5 dias
(0 Comentários)

See private message.

$42.5 USD in 5 dias
(0 Comentários)