Closed happydasch closed 4 years ago
I tried to write some code to reproduce the issue but its hard to reproduce it. I will open another issue when having some testing code.
I add this as a reference here, since this may look like the issue i encounter.
https://community.backtrader.com/topic/1367/error-__len__-should-return-0-on-livefeed/4 https://community.backtrader.com/topic/642/iqfeed-store-and-feed-help-needed/12
When having different feeds:
and _runnext is called because dt for resampled feed moved forward, Cerebro will break at the following block:
https://github.com/backtrader2/backtrader/blob/d465c77f7a8221900d1635dfe63fd04e9632e01b/backtrader/cerebro.py#L1557
since the code:
(d for i, d in enumerate(dts) if d is not None and i not in rsonly)
will sometimes not return any data feeds (resampled feed is in rsonly)
i fixed this by changing it to the code below, but I am not sure about the consequences of this.
(d for i, d in enumerate(dts) if (d is not None and (i not in rsonly or not onlyresample)))