DGabri/tick_data_aggregator ? reverse-engineered prompt

Reverse engineered prompt

Build me a small C command line tool that takes raw tick data from Binance or Bybit and turns it into OHLC candlesticks for whatever resample interval I pass in, like 60 seconds.

I want it to read a tick data file, aggregate the prices into open, high, low, close, and also include buy and sell volume if the data has that info. Then it should write the result to a CSV file. Keep it simple to run from the terminal, something like passing the input file, output file, and the resample frequency as arguments.

Please make it work with the kind of data those exchanges provide, and structure it so I can build it with make and run it easily. If you need to check the current CSV formats or any details from Binance or Bybit, look them up online first.