Key concepts - Hummingbot
URL: https://hummingbot.org/developers/strategies/key-concepts
Contents:
- Key concepts
- Strategy folder¶
- StrategyBase class¶
- Market class¶
- Configuration¶
- Important commands¶
- Exposing new strategy to Hummingbot client¶
- Setting question prompts for strategy parameters¶
Each strategy is contained in its own folder, with the strategy name as the folder name:
All strategies extend the StrategyBase class. This class allows extraction of logic that would be repetitively written in all strategies otherwise.
The base class also contains methods that are meant to be freshly implemented when new strategies are created.
To assist in the development of custom strategies, there are many overridable functions that respond to various events detected by EventListeners.
The ExchangeBase class contains overridable functions that can help get basic information about an exchange that a strategy is operating on, which can include the balance, prices, and order books for any particular asset traded on the exchange.
Additionally, this strategy leverages the OrderTracker listener object, in order to check if buy/sell orders have been filled or completed, the user has enough balance to place certain orders, and if there are any order cancellations. The HummingbotLogger object is also used to log the specific events when they occur.
Important commands on Hummingbot client:
The strategy name is made known to the client automatically in hummingbot/client/settings.py under STRATEGIES variable. There should also be a template file that contains config variables and its documentation in the hummingbot/templates directory. The naming convention for this yml file is conf_{strategy name}_TEMPLATE.
Strategy parameters can be set in the config_map file. Each parameter (represented as dictionary key) is mapped to a ConfigVar type where developer can specify the name of the parameter, prompts that will be provided to the user, and validator that will check the values entered.