Exemplo n.º 1
0
 def _current_ticker_extractor(cls, ccy, data, btc_amount=0):
     ''' method for testing current ticker '''
     url = cls.TICKER_URL.format(ccy)
     data = get_response(url, ccy)
     level = cls._pick_level(btc_amount) if btc_amount > 0 else 'small'
     ask = apply_format(str(data[level]['ask']))
     bid = apply_format(str(data[level]['bid']))
     return Ticker(ccy, bid, ask).toJSON()
Exemplo n.º 2
0
 def get_current_ask(cls, ccy, btc_amount=0.1):
     ''' method for testing current ask price '''
     url = cls.TICKER_URL.format(ccy)
     data = get_response(url, ccy)
     level = cls._pick_level(btc_amount) if btc_amount > 0 else 'small'
     price = str(data[level]['ask'])
     return apply_format(price)
Exemplo n.º 3
0
 def _current_ticker_extractor(cls, data):
     bid = apply_format(data.get('bid'))
     ask = apply_format(data.get('ask'))
     return Ticker(cls.CCY_DEFAULT, bid, ask).toJSON()
Exemplo n.º 4
0
 def _current_ticker_extractor(cls, data):
     bid = apply_format(data["bid"])
     ask = apply_format(data["ask"])
     return Ticker(cls.CCY_DEFAULT, bid, ask).toJSON()
Exemplo n.º 5
0
 def _current_price_extractor(cls, data):
     return apply_format(data.get('last_trade'))
Exemplo n.º 6
0
 def _current_price_extractor(cls, data):
     return apply_format(data.get('ticker', {}).get('last'))
Exemplo n.º 7
0
 def _current_ask_extractor(cls, data):
     return apply_format(data.get('ticker', {}).get('sell'))
Exemplo n.º 8
0
 def _current_ask_extractor(cls, data):
     return apply_format(data[cls.PAIR].get('sell'))
Exemplo n.º 9
0
 def _current_price_extractor(cls, data):
     price = data["tickers"][0]["last"]
     return apply_format(price)
Exemplo n.º 10
0
 def _current_ask_extractor(cls, data):
     ''' current ask price extractor '''
     return apply_format(data.get('ask'))
Exemplo n.º 11
0
 def get_current_price(cls, ccy):
     ''' method for testing last price '''
     url = cls.TICKER_URL.format(ccy)
     data = get_response(url, ccy)
     price = str(data['index'])
     return apply_format(price)
Exemplo n.º 12
0
 def _current_price_extractor(cls, data):
     ''' current price extractor '''
     return apply_format(data.get('last'))
Exemplo n.º 13
0
 def _current_bid_extractor(cls, data):
     ''' current bid price extractor '''
     return apply_format(data.get('bid'))
Exemplo n.º 14
0
 def _current_ticker_extractor(cls, data):
     ask = data["tickers"][1]["ask"]
     bid = data["tickers"][1]["bid"]
     return Ticker(cls.CCY_DEFAULT, apply_format(bid), apply_format(ask)).toJSON()
Exemplo n.º 15
0
 def _current_ask_extractor(cls, data):
     ask = data["tickers"][1]["ask"]
     return apply_format(ask)
Exemplo n.º 16
0
 def _current_bid_extractor(cls, data):
     bid = data["tickers"][1]["bid"]
     return apply_format(bid)
Exemplo n.º 17
0
 def _current_price_extractor(cls, data):
     return apply_format(data[cls.PAIR].get('last'))
Exemplo n.º 18
0
 def _current_price_extractor(cls, data):
     return apply_format(data['last_traded_price'])
Exemplo n.º 19
0
 def _current_bid_extractor(cls, data):
     return apply_format(data[cls.PAIR].get('buy'))
Exemplo n.º 20
0
 def _current_ask_extractor(cls, data):
     return apply_format(data['ask'])
Exemplo n.º 21
0
 def _current_ticker_extractor(cls, data):
     print data
     return Ticker(cls.CCY_DEFAULT, apply_format(data[cls.PAIR].get('buy')), apply_format(data[cls.PAIR].get('sell'))).toJSON()
Exemplo n.º 22
0
 def _current_ticker_extractor(cls, data):
     ''' Method for extracting ticker '''
     bid = apply_format(data.get('best_bid'))
     ask = apply_format(data.get('best_ask'))
     return Ticker(cls.CCY_DEFAULT, bid, ask).toJSON()
Exemplo n.º 23
0
 def _current_bid_extractor(cls, data):
     return apply_format(data['bid'])
Exemplo n.º 24
0
 def _current_price_extractor(cls, data):
     ''' Method for extracting current price '''
     return apply_format(data.get('last_price'))
Exemplo n.º 25
0
 def _current_ticker_extractor(cls, data):
     return Ticker(cls.CCY_DEFAULT, apply_format(data['bid']), apply_format(data['ask'])).toJSON()
Exemplo n.º 26
0
 def _current_bid_extractor(cls, data):
     ''' Method for extracting bid price '''
     return apply_format(data.get('bid'))
Exemplo n.º 27
0
 def _current_bid_extractor(cls, data):
     return apply_format(data.get('ticker', {}).get('buy'))
Exemplo n.º 28
0
 def _current_ask_extractor(cls, data):
     ''' Method for extracting ask price '''
     return apply_format(data.get('ask'))
Exemplo n.º 29
0
 def _current_ticker_extractor(cls, data):
     return Ticker(cls.CCY_DEFAULT, apply_format(data.get('ticker', {}).get('buy')), apply_format(data.get('ticker', {}).get('sell'))).toJSON()
Exemplo n.º 30
0
 def _current_ask_extractor(cls, data):
     return apply_format(data["result"]["ask"])