Ejemplo n.º 1
0
    def __init__(self):

        print("Initializing API")
        try:
            self.zaif_api = ZaifTradeApi(key=str(ks.zaif_api),
                                         secret=str(ks.zaif_secret))
        except Exception:
            print('Cant initialize Zaif API')
            self.initlize[0] = 1
        try:
            self.quoinex_api = client.Quoinex(api_token_id=str(ks.quoinex_api),
                                              api_secret=(ks.quoinex_secret))
        except Exception:
            print('Cant initialize Quoinex API')
            self.initlize[1] = 1

        try:
            self.bitbank_api = private_api.bitbankcc_private(
                api_key=str(ks.bitbank_api), api_secret=str(ks.bitbank_secret))
        except Exception:
            print('Cant initialize Bitbank API')
            self.initlize[2] = 1

        try:
            self.bitflyer_api = pybitflyer.API(api_key=str(ks.bitflyer_api),
                                               api_secret=str(
                                                   ks.bitflyer_secret))
        except Exception:
            print('Cant initialize bitflyer API')
            self.initlize[3] = 1
Ejemplo n.º 2
0
 def __init__(self, holdflag = False, order_places = {'exist': False, 'type': '','id': 0,'remain' : 0.0, 'trade_price' : '', 'slide': 0.0}, tradeamount = 1000, position = 0.0):
     print("Initializing API")
     self.bitflyer_api = pybitflyer.API(api_key=str(ks.bitflyer_api), api_secret=str(ks.bitflyer_secret))
     self.holdflag = holdflag # if hold bitcoin
     self.order_places = order_places # specific an exist order
     self.tradeamount = tradeamount # init trade amount only if order not exist
     self.position = position # remain position (btc)
     self.initeverhold()
Ejemplo n.º 3
0
 def __init__(self):
     print("Initializing API")
     self.bitflyer_api = pybitflyer.API(api_key=str(ks.bitflyer_api), api_secret=str(ks.bitflyer_secret))
     self.zaif_api = ZaifTradeApi(key=str(ks.zaif_api), secret=str(ks.zaif_secret))
     self.quoinex_api = client.Quoinex(api_token_id=str(ks.quoinex_api), api_secret=(ks.quoinex_secret))
     self.bitbank_api = private_api.bitbankcc_private(api_key=str(ks.bitbank_api), api_secret=str(ks.bitbank_secret))
     self.btcbox_api = btcboxapis.boxapi(api_key=str(ks.btcbox_api), api_secret=str(ks.btcbox_secret))
     self.coincheck_api = order.Order(access_key=str(ks.coincheck_api), secret_key=str(ks.coincheck_secret))
Ejemplo n.º 4
0
def get_bid_ask_bitflyer(product_pair):
    if product_pair == '':
        product_pair = 'BTC_JPY'
    elif product_pair == 'BTC_ETH':
        product_pair = 'ETH_BTC'
    elif product_pair == 'BTC_LTC':
        product_pair = 'LTC_BTC'
    bitflyer_api = pybitflyer.API()
    jsons_dict = bitflyer_api.ticker(product_code='%s' % (product_pair))
    bid = jsons_dict['best_bid']
    ask = jsons_dict['best_ask']
    return [bid, ask]
Ejemplo n.º 5
0
 def __init__(self,
              holdflag=False,
              order_places={
                  'exist': False,
                  'type': '',
                  'id': 0,
                  'remain': 0.0
              },
              tradeamount=1000):
     print("Initializing API")
     self.bitflyer_api = pybitflyer.API(api_key=str(ks.bitflyer_api),
                                        api_secret=str(ks.bitflyer_secret))
     #self.zaif_api = ZaifTradeApi(key=str(ks.zaif_api), secret=str(ks.zaif_secret))
     self.quoinex_api = client.Quoinex(api_token_id=str(ks.quoinex_api),
                                       api_secret=(ks.quoinex_secret))
     #self.bitbank_api = private_api.bitbankcc_private(api_key=str(ks.bitbank_api), api_secret=str(ks.bitbank_secret))
     self.holdflag = holdflag
     self.order_places = order_places
     self.tradeamount = tradeamount
Ejemplo n.º 6
0
    def __init__(self):

        print("Initializing API")
        try:
            self.zaif_api = ZaifTradeApi(key=str(ks.zaif_api), secret=str(ks.zaif_secret))
        except Exception:
            print('Cant initialize zaif API')
            self.initlize[0] = 1
        try:
            self.quoinex_api = client.Quoinex(api_token_id=str(ks.quoinex_api), api_secret=(ks.quoinex_secret))
        except Exception:
            print('Cant initialize quoinex API')
            self.initlize[1] = 1

        try:
            self.bitbank_api = private_api.bitbankcc_private(api_key=str(ks.bitbank_api),
                                                             api_secret=str(ks.bitbank_secret))
        except Exception:
            print('Cant initialize bitbank API')
            self.initlize[2] = 1

        try:
            self.bitflyer_api = pybitflyer.API(api_key=str(ks.bitflyer_api), api_secret=str(ks.bitflyer_secret))
        except Exception:
            print('Cant initialize bitflyer API')
            self.initlize[3] = 1

        try:
            self.btcbox_api = btcboxapis.boxapi(api_key=str(ks.btcbox_api), api_secret=str(ks.btcbox_secret))
        except Exception:
            print('Cant initialize btcbox API')
            self.initlize[4] = 1

        try:
            self.coincheck_api = order.Order(access_key=str(ks.coincheck_api), secret_key=str(ks.coincheck_secret))
        except Exception:
            print('Cant initialize btcbox API')
            self.initlize[5] = 1
 def __init__(self):
     print("Initializing API")
     self.bitflyer_api = pybitflyer.API(api_key=str(ks.bitflyer_api),
                                        api_secret=str(ks.bitflyer_secret))
Ejemplo n.º 8
0
def print_bitflyer():
    bitflyer_api = pybitflyer.API()
    print(bitflyer_api.ticker(product_code="BTC_JPY"))
Ejemplo n.º 9
0
def print_bitflyer():
    bitflyer_api = pybitflyer.API()
    print(bitflyer_api.ticker())