(backtesting_data, strategy_config,
enable_logs=False, enable_storage=False,
strategy_func=None, initialize_func=None,
tentacles_config=None, profile_id=None)
| 26 | |
| 27 | |
| 28 | async 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 | |
| 62 | def _resolve_run_tentacles_config(backtesting_data, strategy_func, tentacles_config, profile_id): |
nothing calls this directly
no test coverage detected