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

IndexError: deque index out of range

  • I was running sample program with these parameters and got
    a 'Index Error: deque index out of range' error after received ~1100 ticks and ~180 ticks for the two data feed.... this error can be re-produced very often but not every time... wonder if anyone has seen this before...

    >> python --port 4001 --data0 AUD.USD-CASH-IDEALPRO --timeframe Seconds --compression 10 --data1 AUD.USD-CASH-IDEALPRO --timeframe1 Seconds --compression1 60 --replay --usestore --trade --notifyall --debug
    :~/dev/t1-p3.5/src/myalgo$ Traceback (most recent call last):
      File "", line 467, in <module>
      File "", line 275, in runstrategy
      File "/home/x/dev/t1-p3.5/lib/python3.5/site-packages/backtrader/", line 810, in run
        runstrat = self.runstrategies(iterstrat)
      File "/home/x/dev/t1-p3.5/lib/python3.5/site-packages/backtrader/", line 940, in runstrategies
      File "/home/x/dev/t1-p3.5/lib/python3.5/site-packages/backtrader/", line 1256, in _runnext
      File "/home/x/dev/t1-p3.5/lib/python3.5/site-packages/backtrader/", line 296, in _next
        super(Strategy, self)._next()
      File "/home/x/dev/t1-p3.5/lib/python3.5/site-packages/backtrader/", line 236, in _next
        clock_len = self._clk_update()
      File "/home/x/dev/t1-p3.5/lib/python3.5/site-packages/backtrader/", line 290, in _clk_update
        for d in self.datas if len(d))
      File "/home/x/dev/t1-p3.5/lib/python3.5/site-packages/backtrader/", line 290, in <genexpr>
        for d in self.datas if len(d))
      File "/home/x/dev/t1-p3.5/lib/python3.5/site-packages/backtrader/", line 163, in __getitem__
        return self.array[self.idx + ago]
    IndexError: deque index out of range

  • administrators

    You are using replay and mixing several data feeds. The current core is known (@RandyT has been the driving force) to have some weaknesses with replay.

    The suggestion for such a mix would be to use resample

Log in to reply

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.