| 117 | |
| 118 | |
| 119 | def _register_script(script_func, strategy_config): |
| 120 | def _local_import_scripts(self, *args): |
| 121 | self._live_script = script_func |
| 122 | original_reload_config = self.reload_config |
| 123 | |
| 124 | async def _local_reload_config(*args, **kwargs): |
| 125 | await original_reload_config(*args, **kwargs) |
| 126 | updated_config = { |
| 127 | commons_constants.CONFIG_ACTIVATION_TOPICS.replace(" ", "_"): |
| 128 | commons_enums.ActivationTopics.FULL_CANDLES.value |
| 129 | } |
| 130 | updated_config.update(strategy_config) |
| 131 | self.trading_config.update(updated_config) |
| 132 | self.reload_config = _local_reload_config |
| 133 | backtester_trading_mode.BacktesterTradingMode._import_scripts = _local_import_scripts |