MCPcopy Create free account
hub / github.com/Drakkar-Software/OctoBot-Script / run

Function run

octobot_script/internal/runners.py:28–59  ·  view source on GitHub ↗
(backtesting_data, strategy_config,
              enable_logs=False, enable_storage=False,
              strategy_func=None, initialize_func=None,
              tentacles_config=None, profile_id=None)

Source from the content-addressed store, hash-verified

26
27
28async def run(backtesting_data, strategy_config,
29 enable_logs=False, enable_storage=False,
30 strategy_func=None, initialize_func=None,
31 tentacles_config=None, profile_id=None):
32 backtest_result = models.BacktestResult(backtesting_data, strategy_config)
33 registered_func = _build_script(strategy_func, initialize_func)
34 _register_script(registered_func, strategy_config)
35 run_tentacles_config = _resolve_run_tentacles_config(
36 backtesting_data,
37 strategy_func,
38 tentacles_config,
39 profile_id,
40 )
41 independent_backtesting = octobot_api.create_independent_backtesting(
42 backtesting_data.config,
43 run_tentacles_config,
44 backtesting_data.data_files,
45 run_on_common_part_only=True,
46 start_timestamp=None,
47 end_timestamp=None,
48 enable_logs=enable_logs,
49 stop_when_finished=False,
50 run_on_all_available_time_frames=True,
51 enforce_total_databases_max_size_after_run=False,
52 enable_storage=enable_storage,
53 backtesting_data=backtesting_data,
54 )
55 await octobot_api.initialize_and_run_independent_backtesting(independent_backtesting)
56 await independent_backtesting.join_backtesting_updater(None)
57 await _gather_results(independent_backtesting, backtest_result)
58 await octobot_api.stop_independent_backtesting(independent_backtesting)
59 return backtest_result
60
61
62def _resolve_run_tentacles_config(backtesting_data, strategy_func, tentacles_config, profile_id):

Callers

nothing calls this directly

Calls 4

_build_scriptFunction · 0.85
_register_scriptFunction · 0.85
_gather_resultsFunction · 0.85

Tested by

no test coverage detected