I have some historical trade date in a csv file in the format: unixtime, price, volume I I want to analyze that data.
I managed to do it in Python, but it's painfully slow (takes me about 2 days to run the algorithm for a 30 day data test).
I'm trying to do it in c/c++ or even Java or Scala, but my main issue is that I have no way to resample the data. I need to resample this data to the format: date time, open, high, low, close, volume for 15 minutes intervals but I can't find any way to do that in c/c++
In Python this does what I want (it uses a pandas Dataframe):
def resample_data(raw_data, time_frame):
# resamples the ticker data in ohlc
resampledData = raw_data.copy()
ohlc_dict = {
'open':'first',
'high':'max',
'low':'min',
'close':'last',
'price':'first'
}
resampledData = resampledData.resample(time_frame, how={'price':ohlc_dict, 'amount':'sum'})
resampledData.amount = resampledData['amount']['sum'].fillna(0.0)
resampledData['price']['close'] = resampledData['price']['close'].fillna(method='pad')
resampledData = resampledData.apply(lambda x: x.fillna(resampledData['price']['close']))
return resampledData
Any ideas (or a library) that does this in c/c++/Java/scala?