等级: 专业版
- 注册:
- 2022-8-5
- 曾用名:
|
楼主 |
发表于 2022-12-21 10:07
|
显示全部楼层
if order.order_id == i[1] and order.status == 'filled':
print(str(order.order_id) )
print(order.status)
print(i[1])
if i[0] == 1:
order_id = sell_close(context.run_info.base_book_id, "Limit", i[3] , 1, order_queue=True,serial_id = 3)
context.grid_position_status[grid_index - 1] = [2, order_id, i[2], i[3]]
break
if i[0] == 2:
order_id = buy_open(context.run_info.base_book_id, "Limit", i[2] , 1, order_queue=True,serial_id = 4)
context.grid_position_status[grid_index -1] = [1, order_id, i[2], i[3]]
break
if i[0] == -1:
order_id = buy_close(context.run_info.base_book_id, "Limit", i[2] , 1, order_queue=True,serial_id = 5)
context.grid_position_status[grid_index -1] = [-2, order_id, i[2], i[3]]
break
if i[0] == -2:
order_id = sell_open(context.run_info.base_book_id, "Limit", i[3] , 1, order_queue=True,serial_id = 6)
context.grid_position_status[grid_index -1] = [-1, order_id, i[2], i[3]]
break
我只有成交之后才会发出平仓单, 而且我也说了多次了,单品种好用 |
|