#用户账号密码 robot01 = data['count']['robot01'] password1 = data['count']['password1'] robot02 = data['count']['robot02'] password2 = data['count']['password2'] token01 = data['count']['token01'] token02 = data['count']['token02'] tradePairCode = 'btc_usdt' while 1: # try: btc_usdt_lastprice = float(robot_fun.getMarketPrice(btc_usdt_url)) # except Exception as e: # continue nowTime = time.time() for i in range(1, 1000000): count1 = round( random.uniform(0.001, data['tradePair']['btc_usdtMaxCount']), 6) req1 = robot_fun.order_buy(robot01, btc_usdt_lastprice, url_order, token01, tradePairCode, count1) #设置等待时间 if round(nowTime) % random.randint(1, i + 2): time.sleep(random.uniform(0, 5)) else: time.sleep(numpy.random.random(5)[random.randint(0, 4)] + 0.5)
#用户账号密码 robot03 = data['count']['robot03'] password1 = data['count']['password1'] robot04 = data['count']['robot04'] password2 = data['count']['password2'] token01 = data['count']['token03'] token02 = data['count']['token04'] tradePairCode = 'ETH_BTC' while 1: try: eth_btc_lastprice = float(robot_fun.getMarketPrice(eth_btc_url)) except Exception as e: continue nowTime = time.time() for i in range(1,10000): count1 = round(random.uniform(0.001, data['tradePair']['eth_btcMaxCount']), 3) req1 = robot_fun.order_buy(robot03, eth_btc_lastprice, url_order, token01, tradePairCode, count1) count2 = round(random.uniform(0.001, data['tradePair']['eth_btcMaxCount']), 3) req2 = robot_fun.order_sell(robot04, eth_btc_lastprice, url_order, token02, tradePairCode, count2) #设置等待时间
#用户账号密码 robot21 = data['count']['robot21'] password1 = data['count']['password1'] robot22 = data['count']['robot22'] password2 = data['count']['password2'] token01 = robot_fun.get_access_token(url_login, robot21, password1) token02 = robot_fun.get_access_token(url_login, robot22, password1) tradePairCode = 'xrp_eth' while 1: try: xrp_eth_lastprice = float(robot_fun.getMarketPrice(xrp_eth_url)) except Exception as e: continue nowTime = time.time() for i in range(1, 1000000): count1 = round(random.uniform(1, data['tradePair']['xrp_ethMaxCount']), 0) req1 = robot_fun.order_buy(robot21, xrp_eth_lastprice, url_order, token01, tradePairCode, count1) #设置等待时间 if round(nowTime) % random.randint(1, i + 2): time.sleep(random.uniform(0, 5)) else: