For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

4 hours of resample data

  • i am using 4 hours of resampledata

    data0 = DataFactory(
            dataname=args.symbol or "MSFT",
        cerebro.resampledata(data0, timeframe=bt.TimeFrame.Minutes, compression=60 * 4)

    and i am fetching 4 hours resample data in def init(self):
    like this

    self.data4h = self.datas[1]  # 240 minute resampled data

    its giving me error

    File "", line 74, in __init__
        self.data4h = self.datas[1]  # 240 minute resampled data
    IndexError: list index out of range

  • I wan not able to recreate your issue using regular data feed from csv file, second data feed was added and len(self.datas) returned 2. I would assume that the issue is connected to the DataFactory class.

Log in to reply