INNER CODE UNIT · Python
start
WISEPLAT/backtrader_bybit · DataExamplesBybit/02 - Symbol data to DF.py:19
def start(self):
for data in self.datas: # Running through all the requested tickers
ticker = data._name
self.df[ticker] = []
self.df_tf[ticker] = self.broker._store.get_interval(data._timeframe, data._compression)
def next(self):
"""Arrival of a new ticker candle"""
for data in self.datas: # Running through all the requested tickers
ticker = data._name
try:
status = data._state # 0 - Live data, 1 - History data, 2 - None
_interval = data.interval
except Exception as e:
if data.resampling == 1:
status = 22
_interval = self.broker._store.get_interval(data._timeframe, data._compression)
_interval = f"_{_interval}"