Example #1
0
if (depth_fteth["data"]["asks"][0] * depth_ethusdt["data"]["asks"][0] < min):
    min = depth_fteth["data"]["asks"][0] * depth_ethusdt["data"]["asks"][0]
    index_min = 2

####### sell algo #######
if (depth_ftusdt["data"]["bids"][0] > max):
    max = depth_ftusdt["data"]["bids"][0]
    index_max = 1
if (depth_fteth["data"]["bids"][0] * depth_ethusdt["data"]["bids"][0] > max):
    max = depth_fteth["data"]["bids"][0] * depth_ethusdt["data"]["bids"][0]
    index_max = 2

####### order algo(buy) #######
if (max > min):
    if (index_min == 1):
        fcoin.market_sell("ftusdt", FT_USDT_QTY)

    elif (index_min == 2):
        fcoin.market_sell("fteth", FT_ETH_QTY)

####### order algo(sell) #######

print("直接買う(index:1):price" + str(depth_ftusdt["data"]["asks"][0]))
print("eth経由で買う(index:2):price" +
      str(depth_fteth["data"]["asks"][0] * depth_ethusdt["data"]["asks"][0]))

print("直接売る(index:1):price" + str(depth_ftusdt["data"]["bids"][0]))
print("eth経由で売る(index:2)price:" +
      str(depth_fteth["data"]["bids"][0] * depth_ethusdt["data"]["bids"][0]))

print("buy index" + str(index_min))
Example #2
0
if (depth_fteth["data"]["asks"][0] * depth_ethusdt["data"]["asks"][0] < min):
    min = depth_fteth["data"]["asks"][0] * depth_ethusdt["data"]["asks"][0]
    index_min = 2

####### sell algo #######
if (depth_ftusdt["data"]["bids"][0] > max):
    max = depth_ftusdt["data"]["bids"][0]
    index_max = 1
if (depth_fteth["data"]["bids"][0] * depth_ethusdt["data"]["bids"][0] > max):
    max = depth_fteth["data"]["bids"][0] * depth_ethusdt["data"]["bids"][0]
    index_max = 2

####### order algo(buy) #######
if (max > min):
    if (index_min == 1):
        fcoin.market_sell("ftusdt", FT_USDT_QTY)

    elif (index_min == 2):
        fcoin.market_sell("ethusdt", ETH_USDT_QTY)

####### order algo(sell) #######

print("直接買う(index:1):price" + str(depth_ftusdt["data"]["asks"][0]))
print("eth経由で買う(index:2):price" +
      str(depth_fteth["data"]["asks"][0] * depth_ethusdt["data"]["asks"][0]))

print("直接売る(index:1):price" + str(depth_ftusdt["data"]["bids"][0]))
print("eth経由で売る(index:2)price:" +
      str(depth_fteth["data"]["bids"][0] * depth_ethusdt["data"]["bids"][0]))

print("buy index" + str(index_min))