Esempio n. 1
0
 def _init_price_sockets(self, time_frames, trader_pairs):
     # add klines
     prices = ["{}{}_{}".format(merge_symbol(symbol).lower(), self._KLINE_KEY, time_frame.value)
               for time_frame in time_frames
               for symbol in trader_pairs]
     # add tickers
     for symbol in trader_pairs:
         prices.append("{}{}".format(merge_symbol(symbol).lower(), self._TICKER_KEY))
     connection_key = self.socket_manager.start_multiplex_socket(prices, self.all_currencies_prices_callback)
     self.open_sockets_keys[self._MULTIPLEX_SOCKET_NAME] = connection_key
Esempio n. 2
0
    def _adapt_symbol(self, symbol):
        if "/" in symbol:
            symbol = merge_symbol(symbol)

        if not self.exchange_manager.get_is_simulated():
            return self._parse_symbol_from_ccxt(symbol)
        else:
            # used only for tests
            return symbol