Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def initialize(self):
try:
await self.initializer.create()
self.independent_backtesting = create_independent_backtesting(
self.config,
self.tentacles_setup_config,
get_backtesting_data_files(self.config),
run_on_common_part_only=self.run_on_common_part_only)
await initialize_and_run_independent_backtesting(self.independent_backtesting, log_errors=False)
await join_independent_backtesting(self.independent_backtesting)
if self.log_report:
log_independent_backtesting_report(self.independent_backtesting)
await stop_independent_backtesting(self.independent_backtesting, memory_check=False)
except Exception as e:
self.logger.error(f"Error when starting backtesting: {e}")
finally:
self.task_manager.stop_tasks()
async def _run_backtesting(config, tentacles_setup_config):
backtesting = create_independent_backtesting(config, tentacles_setup_config, [DATA_FILES["ETH/USDT"]], "")
await initialize_and_run_independent_backtesting(backtesting, log_errors=False)
await join_independent_backtesting(backtesting)
return backtesting