Expected behavior for Resample with gaps?
-
My data is of 1-min timeframe and I'm resampling it to 5-min.
but sometimes the 1-min data have gaps (let's say up to 10 min gaps)what is backtrader expected behavior for resampling if gap is <5-min?
and what if gap>5-min? -
Easy: no data no bar. Why should it be otherwise?
-
Then it is quite a surprise.
lets say only 1 min is missing out of 5 needed (most likely cause no trade was actually made in that time, which happens very frequently)I don't understand why a resample won't happen with 4 out of the 5 minute?
for me, it make more sense to work with the missing values (first price available is open, last for close, min-max for high and low, and sum for volume) instead of disregarding them completelyfor the case when we are missing the whole 5 min, I agree 'no data no bar'
I would have expected that if i have at least one bar available I can resample to higher time frame
say we have the following data:
min |the smaller the timeframe the higher the chance of gaps in the data
-
@jacob said in Expected behavior for Resample with gaps?:
Then it is quite a surprise.
You should probably read your own question and re-read the answer.
@jacob said in Expected behavior for Resample with gaps?:
I don't understand why a resample won't happen with 4 out of the 5 minute?
You understand it wrong. "No data no bar" means that. In this case there is data.