For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Resampling issues with ccxt store
I'm having issues using the resampling functionality with data coming from ccxt store (binance exchange).
I do the following (simplified) to get the 1 minute and 5 minutes data
data = store.getdata( dataname='%s/%s' % (COIN_TARGET, COIN_REFER), name='%s%s' % (COIN_TARGET, COIN_REFER), timeframe=bt.TimeFrame.Minutes, fromdate=hist_start_date, compression=1, ohlcv_limit=99999, drop_newest=True ) cerebro.adddata(data) cerebro.resampledata(data, timeframe=bt.TimeFrame.Minutes, compression=5)
But I keep getting:
min() arg is an empty sequence File "lib/python3.8/site-packages/backtrader/cerebro.py", line 1560, in _runnext dt0 = min((d for i, d in enumerate(dts) File "lib/python3.8/site-packages/backtrader/cerebro.py", line 1298, in runstrategies self._runnext(runstrats) File "lib/python3.8/site-packages/backtrader/cerebro.py", line 1127, in run runstrat = self.runstrategies(iterstrat)
The error only occurs after the resample filter actually produces a value. I'm at loss of what I'm doing wrong. Has anybody else got resampling working with live data? Similar questions only use CSV data.
Any help would be appreciated. Thanks