Do you know if this compression is the same as when done by backtrader (ie bar2edge, boundoff, rightedge etc?
I believe so
I noticed that you can have very different presentation of 5mn, 1h etc data depending of the data provider. For me, it was differences between data from MT5 & data resampled by BT. For example, 1h data from MT5 had a different close value. You may want to check the M5 & H1 open & close values to find if it is the one of neighboring minutes and also check the doc to find if some additional parameters (boundoff, rightedge etc.) can bring you the results you want
Also, I noticed during my tests that if some minutes are missing, the resampling to for ex. H8 may lead to errors (closure of the bar occur later than expected - I still have to find the time to log an issue in BT2 for that)