Resampling a DataFrame to hourly 15min and 5min periods in Julia

Viewed 1856

I'm quite new to Julia but I'm giving it a try since the benchmarks claim it to be much faster than Python.

I'm trying to use some stock tick data in the format ["unixtime", "price", "amount"]

I managed to load the data and convert the unixtime to a date in Julia, but now I need to resample the data to use olhc (open, high, low, close) for the price and sum for the amount, for a specific period in Julia (hourly, 15min, 5 min, etc...):

julia> head(btc_raw_data)
6x3 DataFrame:
                           date price  amount
[1,]    2011-09-13T13:53:36 UTC   5.8     1.0
[2,]    2011-09-13T13:53:44 UTC  5.83     3.0
[3,]    2011-09-13T13:53:49 UTC   5.9     1.0
[4,]    2011-09-13T13:53:54 UTC   6.0    20.0
[5,]    2011-09-13T14:32:53 UTC  5.95 12.4521
[6,]    2011-09-13T14:35:04 UTC  5.88   7.458

I see there is a package called Resampling, but it doesn't seem to accept a time period only the number of row I want the output data to have.

Any other alternatives?

1 Answers
Related