Just new to Python programming. So I have crypto OHLCV data on the four hour timeframe. I want to convert them to daily, weekly, and monthly data. The data is in a csv file. Here is a sample:
BTCUSDT 06/01/2021 , 08:00:00 37253.82 37894.81 36478 36704.99 14647.05841 BTCUSDT 06/01/2021 , 12:00:00 36706.8 37443.72 36561.89 36831.58 10095.34783 BTCUSDT 06/01/2021 , 16:00:00 36831.58 36939.81 35902.43 36596.62 13819.88776 BTCUSDT 06/01/2021 , 20:00:00 36596.63 37440 35666 36235.29 22029.82561 BTCUSDT 06/02/2021 , 00:00:00 36235.28 36492.89 35716.66 35973.87 12918.45296 BTCUSDT 06/02/2021 , 04:00:00 35973.86 36800 35873.08 36693.09 7724.091195 ETHUSDT 06/01/2021 , 08:00:00 2706.15 2740 2612.63 2630.79 190770.2435 ETHUSDT 06/01/2021 , 12:00:00 2630.66 2716.33 2615.27 2652.53 166661.3018 ETHUSDT 06/01/2021 , 16:00:00 2652.37 2672.6 2547.12 2624.09 263021.1097 ETHUSDT 06/01/2021 , 20:00:00 2624.23 2666 2523.74 2568.49 294840.3197 ETHUSDT 06/02/2021 , 00:00:00 2568.62 2588 2535.72 2634.57 125258.4908 BNBUSDT 06/01/2021 , 08:00:00 353.37 364.4 343.42 345.77 727379.1453 BNBUSDT 06/01/2021 , 12:00:00 345.74 360 343.74 349.06 599663.416 BNBUSDT 06/01/2021 , 16:00:00 349.14 357.21 339.48 353.79 802504.2916 BNBUSDT 06/01/2021 , 20:00:00 353.83 358.18 342 348.85 700365.912 BNBUSDT 06/02/2021 , 00:00:00 348.85 355.19 345.77 349.74 377847.017
(The order of the columns from left to right: symbol, opening time, open, high, low, close, volume)
Source of data is from the binance. I could have just opted to download the daily timeframe, etc but I can't because:
- it takes a lot of time to download data across different timeframes so I just opted to download lower timeframe and build higher timeframe data from them
- I frequently get errors when downloading from the binance api (bec I probably reached the max limit of requests) so I'm minimizing my downloads to just the lower timeframes
- lastly, when I download the daily, the opening data seems to start at 8:00:00 instead of at 00:00:00. Probably because the timezone in my area is UTC + 8.
I have seen a few variations of my question asked online with the solutions given using the pandas library. But being a newbie, I have difficulty understanding them (stuff like the index) so I prefer to not use libraries like pandas.