diff --git a/hummingbot/client/command/config_command.py b/hummingbot/client/command/config_command.py index 60f7d8900c..2e145380a5 100644 --- a/hummingbot/client/command/config_command.py +++ b/hummingbot/client/command/config_command.py @@ -36,6 +36,7 @@ no_restart_pmm_keys_in_percentage = ["bid_spread", "ask_spread", "order_level_spread", "inventory_target_base_pct"] no_restart_pmm_keys = ["order_amount", "order_levels", "filled_order_delay", "inventory_skew_enabled", "inventory_range_multiplier"] global_configs_to_display = ["0x_active_cancels", + "autofill_import", "kill_switch_enabled", "kill_switch_rate", "telegram_enabled", diff --git a/hummingbot/client/command/import_command.py b/hummingbot/client/command/import_command.py index cd9b54cdbd..5799f3a2f4 100644 --- a/hummingbot/client/command/import_command.py +++ b/hummingbot/client/command/import_command.py @@ -1,6 +1,7 @@ import os from hummingbot.core.utils.async_utils import safe_ensure_future +from hummingbot.client.config.global_config_map import global_config_map from hummingbot.client.config.config_helpers import ( update_strategy_config_map_from_file, short_strategy_name, @@ -43,6 +44,9 @@ async def import_config_file(self, # type: HummingbotApplication self.app.change_prompt(prompt=">>> ") if await self.status_check_all(): self._notify("\nEnter \"start\" to start market making.") + autofill_import = global_config_map.get("autofill_import").value + if autofill_import is not None: + self.app.set_text(autofill_import) async def prompt_a_file_name(self # type: HummingbotApplication ): diff --git a/hummingbot/client/config/global_config_map.py b/hummingbot/client/config/global_config_map.py index 31bd7e566d..82b1cf2e8b 100644 --- a/hummingbot/client/config/global_config_map.py +++ b/hummingbot/client/config/global_config_map.py @@ -196,6 +196,14 @@ def global_token_symbol_on_validated(value: str): default=-100, validator=lambda v: validate_decimal(v, Decimal(-100), Decimal(100)), required_if=lambda: global_config_map["kill_switch_enabled"].value), + "autofill_import": + ConfigVar(key="autofill_import", + prompt="What to auto-fill in the prompt after each import command? (start/config) >>> ", + type_str="str", + default=None, + validator=lambda s: None if s in {"start", + "config"} else "Invalid auto-fill prompt.", + required_if=lambda: False), "telegram_enabled": ConfigVar(key="telegram_enabled", prompt="Would you like to enable telegram? >>> ", diff --git a/hummingbot/templates/conf_global_TEMPLATE.yml b/hummingbot/templates/conf_global_TEMPLATE.yml index 4fd7853924..6785aa3f97 100644 --- a/hummingbot/templates/conf_global_TEMPLATE.yml +++ b/hummingbot/templates/conf_global_TEMPLATE.yml @@ -3,7 +3,7 @@ ################################# # For more detailed information: https://docs.hummingbot.io -template_version: 19 +template_version: 20 # Exchange configs bamboo_relay_use_coordinator: false @@ -105,6 +105,9 @@ kill_switch_enabled: null # The rate of performance at which you would want the bot to stop trading (-20 = 20%) kill_switch_rate: null +# What to auto-fill in the prompt after each import command (start/config) +autofill_import: null + # DEX active order cancellation 0x_active_cancels: false