##窗口置顶 root.wm_attributes('-topmost', 1) ##label标签设置文本变量 Label(root, textvariable=var, font=100).pack() while True: time.sleep(1) try: # if gate_query.ticker('btc_usdt')['lowestAsk'] > 7700: # print ('gogogoogogogogogogo') # os.system("1.mp3") # var.set("BUY: "+str(gate_query.ticker('btc_usdt')['lowestAsk']) \ # +"~~~ SELL: "+str(gate_query.ticker('btc_usdt')['highestBid'])+'~~~~'+str(when.now().strftime("%H:%M:%S"))) # root.update() print ("TRX_BUY: " +str(gate_query.ticker('trx_usdt')['lowestAsk']) \ +"~~~~SELL: "+str(gate_query.ticker('trx_usdt')['highestBid'])+'~~~~'+str(when.now().strftime("%H:%M:%S"))) except: pass # Market depth of pair # print(gate_query.orderBook('btc_usdt')) # Trade History # print(gate_query.tradeHistory('btc_usdt')) # Get account fund balances # print(gate_trade.balances()) # get new address # print(gate_trade.depositAddres('btc'))
##窗口置顶 root.wm_attributes('-topmost',1) ##label标签设置文本变量 Label(root, textvariable = var,font = 100).pack() while True: time.sleep(1) try: # if gate_query.ticker('btc_usdt')['lowestAsk'] > 7700: # print ('gogogoogogogogogogo') # os.system("1.mp3") # var.set("BUY: "+str(gate_query.ticker('btc_usdt')['lowestAsk']) \ # +"~~~ SELL: "+str(gate_query.ticker('btc_usdt')['highestBid'])+'~~~~'+str(when.now().strftime("%H:%M:%S"))) # root.update() print ("TRX_BUY: " +str(gate_query.ticker('trx_usdt')['lowestAsk']) \ +"~~~~SELL: "+str(gate_query.ticker('trx_usdt')['highestBid'])+'~~~~'+str(when.now().strftime("%H:%M:%S"))) except: pass # Market depth of pair # print(gate_query.orderBook('btc_usdt')) # Trade History # print(gate_query.tradeHistory('btc_usdt')) # Get account fund balances # print(gate_trade.balances()) # get new address # print(gate_trade.depositAddres('btc'))
# Market Details # print(gate_query.marketlist()) # Tickers # print(gate_query.tickers()) # Depth # print(gate_query.orderBooks()) # orders # print(gate_query.openOrders()) ## Below, use methods that make use of the users keys # Ticker print(gate_query.ticker('btc_usdt')) from tkinter import * import time import when import os root = Tk() ##tk中独有的变量 var = StringVar() root.title ("BTC") ##窗口置顶 root.wm_attributes('-topmost',1) ##label标签设置文本变量 Label(root, textvariable = var,font = 100).pack()
print("返回系统支持的所有交易对的 最新,最高,最低 交易行情和交易量,每10秒钟更新,如果后面添加具体的参数就是单个的币种的具体详情") print(gate_query.tickers()) # Depth print("返回系统支持的所有交易对的市场深度(委托挂单),其中 asks 是委卖单, bids 是委买单,如果后面有具体的参数则是具体币种的深度详情") print(gate_query.orderBooks()) # orders print("获取我的当前挂单列表API") print(gate_query.openOrders()) # 下面的都是需要个人用户的秘钥的api,基本都是操作个人用户的api ## Below, use methods that make use of the users keys # Ticker print("具体交易的行情") print(gate_query.ticker('btc_usdt')) # Market depth of pair print("交易对的市场深度") print(gate_query.orderBook('btc_usdt')) # Trade History print("返回最新80条历史成交记录") print(gate_query.tradeHistory('btc_usdt')) # Get account fund balances print("获取帐号资金余额API") print(gate_trade.balances()) # get new address print(gate_trade.depositAddres('btc'))
import when import os root = Tk() ##tk中独有的变量 var = StringVar() root.title ("BTC") ##窗口置顶 root.wm_attributes('-topmost',1) ##label标签设置文本变量 Label(root, textvariable = var,font = 100).pack() while True: time.sleep(1) try: if float(gate_query.ticker('ocn_usdt')['lowestAsk']) <= 0.03: os.system("1.mp3") elif float(gate_query.ticker('btm_usdt')['lowestAsk']) < 0.091: os.system("1.mp3") elif float(gate_query.ticker('trx_usdt')['lowestAsk']) < 0.081: os.system("1.mp3") # var.set("BUY: "+str(gate_query.ticker('btc_usdt')['lowestAsk']) \ # +"~~~ SELL: "+str(gate_query.ticker('btc_usdt')['highestBid'])+'~~~~'+str(when.now().strftime("%H:%M:%S"))) # root.update() print ("ocn_"+"BUY: "+str(gate_query.ticker('ocn_usdt')['lowestAsk']) \ +"~~~SELL: "+str(gate_query.ticker('ocn_usdt')['highestBid'])+'~~~~'+str(when.now().strftime("%H:%M:%S"))) except: pass
import when import os root = Tk() ##tk中独有的变量 var = StringVar() root.title ("BTC") ##窗口置顶 root.wm_attributes('-topmost',1) ##label标签设置文本变量 Label(root, textvariable = var,font = 100).pack() while True: time.sleep(1) try: if float(gate_query.ticker('ocn_usdt')['lowestAsk']) <= 0.03: os.system("1.mp3") elif float(gate_query.ticker('btm_usdt')['lowestAsk']) < 0.091: os.system("1.mp3") elif float(gate_query.ticker('trx_usdt')['lowestAsk']) < 0.081: os.system("1.mp3") # var.set("BUY: "+str(gate_query.ticker('btc_usdt')['lowestAsk']) \ # +"~~~ SELL: "+str(gate_query.ticker('btc_usdt')['highestBid'])+'~~~~'+str(when.now().strftime("%H:%M:%S"))) # root.update() print ("xvgC:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-packages\webview\_"+"BUY: "+str(gate_query.ticker('xvg_usdt')['lowestAsk']) \ +"~~~SELL: "+str(gate_query.ticker('xvg_usdt')['highestBid'])+'~~~~'+str(when.now().strftime("%H:%M:%S"))) except: pass
# encoding: utf-8 from gateAPI import GateIO # 填写 APIKEY APISECRET apikey = 'your api key' secretkey = 'your api secret' API_URL = 'data.gate.io' gate = GateIO(API_URL, apikey, secretkey) # 所有交易对 pairs = gate.pairs() print(gate.pairs()) for item in pairs: print gate.ticker(item) # 市场订单参数 # print (gate.marketinfo()) # 交易市场详细行情 # print (gate.marketlist()) # 所有交易行情 # print (gate.tickers()) # 单项交易行情 # print (gate.ticker('btc_usdt')) # 所有交易对的市场深度 # print (gate.orderBooks())
# print(gate_query.marketlist()) # Tickers # print(gate_query.tickers()) # Depth # print(gate_query.orderBooks()) # orders # print(gate_query.openOrders()) ## Below, use methods that make use of the users keys # Ticker while(True): print(gate_query.ticker('btc_usdt')['last']) time.sleep(2) # Market depth of pair #print(gate_query.orderBook('btc_usdt')) # Trade History # print(gate_query.tradeHistory('btc_usdt')) # Get account fund balances # print(gate_trade.balances()) # get new address # print(gate_trade.depositAddres('btc')) # get deposit withdrawal history