I have a csv file with 5m ohlc data, it looks like this:
T,O,H,L,C
2018-01-01 00:00:00+00:00, 13838.5, 13961, 13838, 13873
2018-01-01 00:05:00+00:00, 13873, 13920, 13800, 13800
2018-01-01 00:10:00+00:00, 13800, 13800.5, 13675, 13771.5
2018-01-01 00:15:00+00:00, 13771.5, 13795, 13711, 13769
I've found a script to download 1m and 5m data from Bitmex, but it seems like you can't directly download 15m candles, I've seen some similar questions where people tried to convert other timeframes but none of them worked for me.
I've tried resample('15Min').ohlc()
but I get an error
TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Index'.
Maybe I'm doing something wrong while reading my csv file:
ohlcv5 = pd.read_csv('5m.csv', names=['T', 'O', 'H', 'L', 'C'], index_col=0, parse_dates=[0])