Please read these notes before running the scripts. 


--- Data set of sequential trades (ticks) for corn futures 

The dataset represents the tick by tick electronic trading of CME (Chicago Merchantile Exchange) May 2014 corn futures for 11 trading days, from Friday March 28, 2014 to through April 11, 2014. There are over 600,000 trades recorded. Times are Pacific Time Zone.  The market opens 1700 hours PT on the day before and continues until 0545 PT  (the night session).  Trading resumes at 0630 and ends at 1115 hours PT (the day session).  

For example, trading for March 28 begins at 1700 hours PT in the evening of March 27. 


--- The csv files 

The file ZCK4-CornMay2014-Ticks.csv is in sequential order, but the date/time column is not unique.
Use the provided R script (convert_tick_data_to_xts.R) to convert it to xts and to make the index unique.

A daily chart is also included, so you can see the forest from the trees (or more accurately, the forest from the leaves on the trees).  If you plot it, you will see a chart similar to what you can find on numerous websites that provide daily commodity charts. (Quandl.com or BarChart.com for example).  

I would suggest that you place all the files from this zipfile into a separate directory.  

--- What is a tick?

A tick is one trade between one seller and one buyer at a fixed price for a fixed quantity of contracts. Accordingly, the data stream shows price and volume (there is no price fluctuation in a single tick). For example, 3 contracts at $4.9500.  In the case of corn contracts, each contract is for 5,000 bushels of corn, so the value of one contract in this example is $4.9500 x 5,000.  Corn is traded on quarter-cents, not decimals.  So prices between $4.95 and $4.96 are $4.9500, $4.9525, $4.9550, $4.9575, and $4.9600.  Because each contract represents 5,000 bushels of corn, the change in price of 1 cent is equal to $50 profit or loss. The minimum 1/4 cent move is equal to $12.50 profit or loss.  A buyer who buys 10 contracts at $4.95 and sells them for one penny more at $4.96, makes $500 (before commissions and fees).

If a seller asks for 10 contracts (at a certain price) and a single buyer bids for 10 (at that price), then that is one trade (or tick) with a volume of 10.  If a seller has 10 contracts (at a certain price) and 3 buyers split it ( i.e., 5, 3 and 2), then that will appear as 3 ticks.  The order of sellers and buyers is first come first served.  

For example, if sellers A followed by B are offering contracts thus: A = 10, B = 20, and buyers C followed by D are bidding thus:  C = 10, D = 20, they will match up in order, A=B (10) then  C=D (20), but if the buyers are E = 10 followed by F = 20, then there will be 3 trades (ticks) A=E (10), then B=E (10), then B=F (10).  So a buyer who wants to buy 100 contracts may generate anywhere from 1 to 100 trades on this chart.  

If before trade is made a higher offer is made by a buyer that new buyer goes to the front of the line.  Likewise if a lower asking price is made by a seller, then that seller goes to the front of the line.
For example. Seller A is at the front of the seller line, selling 100 contracts at 50.  Buyer B is at the front of the buyer line, and is willing to buy 10 contracts at the same price (50).  A sells 10 to B, and has 90 more to sell.  Now Seller C shows up offering to sell 20 contracts at 49 (at a lower price).  C goes in front of A, so C will sell before A. 

The price paid is never higher than than the lowest price asked by the front Seller, and never higher than the highest price bid by the front Buyer. 

Prices can also change when a 'market order' comes in.  A buyer says 'buy 100 at the market'. If in line are sellers A=20 contracts at 15, B=50 contracts at 15 (same price) then C= 100 contracts at 16 (a higher price), the buyer will trigger 3 trades A for 20 at 15, B for 50 at 15, and C for 30 at 16.  C will still be at the front of the seller line with 70 unsold contracts.

--- Additional information about the data set

The USDA issues agricultural reports on a regular basis.  Sometimes reports are issued while the market is open (typically at 900 hours PT).  These reports have an immediate (within seconds) impact on trading volume and volatility.  During the time period of the data set, reports were released on March 31 at 900 hours, and on April 9, 2014 at 900.  

Copies of the USDA reports issued (obtained from http://usda.mannlib.cornell.edu/MannUsda/displayCalendar.do for those dates) have been included for reference.   If you are hesitant about opening these files for any reason, get fresh copies from that link. 

A daily chart is also included (similar to what you can look at on BarChart.com).  When looking at the daily chart, there is considerable volume and volatility earlier in March. This is associated with the world events surrounding the Russian takeover of Crimea from Ukraine. Ukraine is a world-provider of corn.  

The tick data is based up the data feed provided to a funded trading account. It is not simulated data. However, no warranty is made as to its accuracy. The last price of any trading day may differ from the official daily 'settlement' price due to the way that settlement prices are set by the CME.

--- Questions ---

If you have questions about what dataset represents, send an email to dougedmunds %AT% gmail.com.  Questions about how to use this data in R should go to the forums.
