2.71K 浏览
0

#获取订单详情
checkonder=api.get_order(‘order_id’)

#获取订单类型
get_order_type=checkonder[‘type’]
print(get_order_type)
#获取订单状态
get_order_state=checkonder[‘state’]
print(get_order_state)
print(type(get_order_state))
以上代码中获取订单详情时返回一个字典
{‘order_id’: ”, ‘exchange_order_id’: ”, ‘exchange_id’: ”, ‘instrument_id’: ”, ‘direction’: ”, ‘offset’: ”, ‘volume_orign’: 0, ‘volume_left’: 0, ‘limit_price’: nan, ‘price_type’: ”, ‘volume_condition’: ”, ‘time_condition’: ”, ‘insert_date_time’: 0, ‘last_msg’: ”, ‘status’: ”}
如何取其中的值?

许 公子 发表新评论 2020年2月17日

print(“委托单”,order.order_id)用这个方法获取到了ID