Exemplo n.º 1
0
def test_feed(symbol):
    """[symbol]  Symbol example: btc/usd or btc:usd."""
    try:
        price = get_gecko_price(symbol_=symbol)
        print(price)
        pair = split_pair(symbol)
        price = get_gecko_price(pair_=pair)
    except Exception as e:
        print_usage()
        print(type(e).__name__, e.args, str(e))
Exemplo n.º 2
0
 def _get_center_price(self):
     symbol = self._symbol
     price = None
     if self._exchange not in self._alt_exchanges:
         price = get_ccxt_price(symbol, self._exchange)
         debug('Use ccxt exchange {} symbol {} price: {}'.format(self.exchange, symbol, price))
     elif self._exchange == 'gecko':
         price = get_gecko_price(symbol_=symbol)
         debug('Use ccxt exchange {} symbol {} price: {}'.format(self.exchange, symbol, price))
     elif self._exchange == 'waves':
         price = get_waves_price(symbol_=symbol)
         debug('Use waves exchange {} symbol {} price: {}'.format(self.exchange, symbol, price))
     return price
Exemplo n.º 3
0
 def _get_center_price(self):
     symbol = self._symbol
     price = None
     if self._exchange not in self._alt_exchanges:
         price = get_ccxt_price(symbol, self._exchange)
         debug("use ccxt exchange ", self._exchange, ' symbol ', symbol,
               ' price:', price)
     elif self._exchange == 'gecko':
         price = get_gecko_price(symbol_=symbol)
         debug("gecko exchange - ", self._exchange, ' symbol ', symbol,
               ' price:', price)
     elif self._exchange == 'waves':
         price = get_waves_price(symbol_=symbol)
         debug("use waves -", self._exchange, ' symbol ', symbol, ' price:',
               price)
     return price