INNER CODE UNIT · Python

__init__

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

    def __init__(self):
        self.df = {}
        self.df_tf = {}

    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:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…