INNER CODE UNIT · Python

next

WISEPLAT/backtrader_bybit · DataExamplesBybit/02 - Symbol data to DF.py:25

    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}"
                else:
                    print("Error:", e)

            if status == 1:
                _state = "Resampled Data"
                if status == 1: _state = "False - History data"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…