Exemple #1
0
 def __init__(self, hummingbot_application):
     super(HummingbotCompleter, self).__init__()
     self.hummingbot_application = hummingbot_application
     self._path_completer = WordCompleter(
         file_name_list(CONF_FILE_PATH, "yml"))
     self._command_completer = WordCompleter(self.parser.commands,
                                             ignore_case=True)
     self._exchange_completer = WordCompleter(sorted(
         CONNECTOR_SETTINGS.keys()),
                                              ignore_case=True)
     self._spot_completer = WordCompleter(sorted(
         EXCHANGES.union(SPOT_PROTOCOL_CONNECTOR)),
                                          ignore_case=True)
     self._spot_exchange_completer = WordCompleter(sorted(EXCHANGES),
                                                   ignore_case=True)
     self._derivative_completer = WordCompleter(DERIVATIVES,
                                                ignore_case=True)
     self._derivative_exchange_completer = WordCompleter(
         DERIVATIVES.difference(DERIVATIVE_PROTOCOL_CONNECTOR),
         ignore_case=True)
     self._connect_option_completer = WordCompleter(CONNECT_OPTIONS,
                                                    ignore_case=True)
     self._export_completer = WordCompleter(["keys", "trades"],
                                            ignore_case=True)
     self._balance_completer = WordCompleter(["limit", "paper"],
                                             ignore_case=True)
     self._history_completer = WordCompleter(
         ["--days", "--verbose", "--precision"], ignore_case=True)
     self._gateway_completer = WordCompleter(
         ["generate_certs", "list-configs", "update"], ignore_case=True)
     self._strategy_completer = WordCompleter(STRATEGIES, ignore_case=True)
     self._py_file_completer = WordCompleter(
         file_name_list(SCRIPTS_PATH, "py"))
     self._rate_oracle_completer = WordCompleter(
         [r.name for r in RateOracleSource], ignore_case=True)
Exemple #2
0
 def _trading_pair_completer(self) -> Completer:
     trading_pair_fetcher = TradingPairFetcher.get_instance()
     for exchange in sorted(list(CONNECTOR_SETTINGS.keys()), key=len, reverse=True):
         if exchange in self.prompt_text:
             market = exchange
             break
     trading_pairs = trading_pair_fetcher.trading_pairs.get(market, []) if trading_pair_fetcher.ready else []
     return WordCompleter(trading_pairs, ignore_case=True, sentence=True)
Exemple #3
0
 def __init__(self, hummingbot_application):
     super(HummingbotCompleter, self).__init__()
     self.hummingbot_application = hummingbot_application
     self._path_completer = WordCompleter(file_name_list(CONF_FILE_PATH, "yml"))
     self._command_completer = WordCompleter(self.parser.commands, ignore_case=True)
     self._connector_completer = WordCompleter(CONNECTOR_SETTINGS.keys(), ignore_case=True)
     self._exchange_completer = WordCompleter(EXCHANGES, ignore_case=True)
     self._derivative_completer = WordCompleter(DERIVATIVES, ignore_case=True)
     self._connect_option_completer = WordCompleter(CONNECT_OPTIONS, ignore_case=True)
     self._export_completer = WordCompleter(["keys", "trades"], ignore_case=True)
     self._balance_completer = WordCompleter(["limit", "paper"], ignore_case=True)
     self._history_completer = WordCompleter(["--days", "--verbose", "--precision"], ignore_case=True)
     self._strategy_completer = WordCompleter(STRATEGIES, ignore_case=True)
     self._py_file_completer = WordCompleter(file_name_list(SCRIPTS_PATH, "py"))