Description Usage Arguments Value Examples
Convert eighth of a cent grain prices to decimal
1 |
x |
is a column of a datatable of Grain contract BBO raw data from CME Group's Datamine. Formatted as.character() from the start it will have 7 characters. Positions: 4 hundreds, 5 tens, 6 ones, and 7 8th of a cent since futures quotes are in cents per bushel and the ticks are 8ths of a cent this function will only work for corn prices < $100/bushel. At this date, grain prices above $100/ bushel are unimaginable. This function is intended to be vectorized over a data.table object as in the example below. |
The column of the orginal datatable with the TrPrice column converted to numeric in decimal format.
1 2 3 4 5 | accum <- as.list(NULL)
accum[[1]] <- as.data.table(bboread('XCBT_C_FUT_110110.TXT'))
accum[[2]] <- as.data.table(bboread('XCBT_C_FUT_110110.TXT')) # accum is a list of two 'days' worth of BBO data
corn_110110 <- data.table::rbindlist(accum)
corn_110110[, Price := decimalprices(corn_110110$TrPrice)]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.