Is this a valid way of analyzing multiple timeframes?
I am adding data, then resampling data to get multiple time frame trend analysis.. but it's the same data feed. Source code:
df = csv_to_pandas(args.data, timeframe="1Min") cerebro_data = bt.feeds.PandasData(dataname=df) logging.info("Adding pandas dataframe to cerebro") cerebro.adddata(cerebro_data) logging.info("Adding resampled pandas dataframe for higher timeframe to cerebro") cerebro.resampledata(cerebro_data, timeframe=bt.TimeFrame.Minutes, compression=60) # 1 hour
Is this correct? For some reason the resulting graph doesn't look right
cerebro_data = bt.feeds.PandasData(dataname=df)
timeframe/compression? The default is
@backtrader I already resampled in pandas... is this "un-kosher"? Should I be letting backtrader doing this?
You can resample 1000 times in
pandasif you wish, there is nothing against it. It will actually probably save you time (more if you save it to disk/database/something-else) and read it from there each time.
But you are simply not telling the platform to what you actually resampled to and therefore the default settings