A config file allows you to define the parameters used in a YAML file. Later, you can modify the values of this file, share it with others, and and import it into your strategy.
These configuration files created and used by Hummingbot are saved in the /conf directory of your instance, which you can edit directly with a standard text editor.
conf/scripts: config files for scripts
conf/controllers: config files for StrategyV2 controllers
conf/strategies: config files for the original "V1" strategies
Starting in v1.24.0, Scripts can define a ScriptConfig class that defines configuration parameters that users can store in a YAML file.
classDManV3ScriptConfig(BaseClientModel):script_file_name:str=Field(default_factory=lambda:os.path.basename(__file__))# Account configurationexchange:str=Field("binance_perpetual",client_data=ClientFieldData(prompt_on_new=True,prompt=lambdami:"Enter the name of the exchange where the bot will operate (e.g., binance_perpetual):"))trading_pairs:str=Field("DOGE-USDT,INJ-USDT",client_data=ClientFieldData(prompt_on_new=True,prompt=lambdami:"List the trading pairs for the bot to trade on, separated by commas (e.g., BTC-USDT,ETH-USDT):"))leverage:int=Field(20,client_data=ClientFieldData(prompt_on_new=True,prompt=lambdami:"Set the leverage to use for trading (e.g., 20 for 20x leverage):"))
This is an optional feature, and more basic scripts may elect to hardcode their parameters in the script file.
Run create command without the --script-config flag to create a Strategy V1 config file. The autocomplete command will display a list of the available V1 strategies, each one a folder in the /hummingbot/strategy folder.
Next, answer the prompts to configure your bot's behavior depending on the strategy you want to use.
The last prompt will ask you to enter a name for the config file. You can also specify the name of your file at the beginning by running create [file_name] command.
You can also skip the prompt by running import [file_name] command.
Sample usage
>>>`import conf_pure_mm_1.yml`
Configuration from conf_pure_mm_1.yml file is imported.
Preliminary checks:
- Exchange check: All connections confirmed.
- Strategy check: All required parameters confirmed.
-All checks: Confirmed.
Enter "start" to start market making
>>> start
While Scripts are single files that contain the types and messages for their parameters, V1 Strategies have a separate pre-defined template configuration file defined by the strategy author.