How to use the backtesting.collector.data_parser.DataCollectorParser.parse function in Backtesting

To help you get started, we’ve selected a few Backtesting examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Drakkar-Software / OctoBot / trading / exchanges / exchange_simulator / exchange_simulator.py View on Github external
relevant_symbols = set(ConfigManager.get_symbols(self.config))

        # parse files
        for file in self.config[CONFIG_BACKTESTING][CONFIG_BACKTESTING_DATA_FILES]:
            exchange_name, symbol, timestamp, data_type = interpret_file_name(file)
            if symbol is not None and symbol in relevant_symbols:
                if exchange_name is not None and timestamp is not None and data_type is not None:

                    # check if symbol data already in symbols
                    # TODO check exchanges ?
                    if symbol not in symbols_appended:
                        symbols_appended[symbol] = 0
                        if symbols_appended[symbol] < int(timestamp):
                            symbols_appended[symbol] = int(timestamp)
                            self.symbols.append(symbol)
                            data = DataCollectorParser.parse(file)
                            self.data[symbol] = self.fix_timestamps(data)