def position(args):
path = args.config['book-path']
if not os.path.isfile(path):
print('Order book empty, use buy command to fill it')
return
data = json.loads(open(path).read())
table_data = [['id', 'Exchange', 'Market', 'Price', 'Current', 'Profit']]
i = 0
while i < len(data):
current = get_last_price_tmp(data[i]['market'])
profit = get_profit(data[i]['last'], current)
table_data.append([data[i]['id'], data[i]['exchange'],
data[i]['market'], data[i]['last'], current , profit])
i += 1
table = SingleTable(table_data)
if args.live:
return(table.table)
else:
print(table.table)
评论列表
文章目录