コード例 #1
0
 def get_exchange_pair(self, pair) -> str:
     try:
         return symbol_util.convert_symbol(
             symbol=pair,
             symbol_separator=octobot_commons.MARKET_SEPARATOR,
             new_symbol_separator=self.CRYPTOFEED_DEFAULT_MARKET_SEPARATOR,
             should_uppercase=True,
         )
     except Exception:
         self.logger.error(f"Failed to get market of {pair}")
     return ""
コード例 #2
0
 def get_exchange_pair(self, pair) -> str:
     """
     Convert an uniformized symbol format to a cryptofeed symbol format
     :param pair: the pair to format
     :return: the cryptofeed pair when success else an empty string
     """
     try:
         return symbol_util.convert_symbol(
             symbol=pair,
             symbol_separator=octobot_commons.MARKET_SEPARATOR,
             new_symbol_separator=self.CRYPTOFEED_DEFAULT_MARKET_SEPARATOR,
             should_uppercase=True,
         )
     except Exception:
         self.logger.error(f"Failed to get market of {pair}")
     return ""
コード例 #3
0
def test_convert_symbol():
    assert convert_symbol("BTC-USDT", symbol_separator="-") == "BTC/USDT"