def
order_status(context,order):
Write.info(context,
'>>> order_status - 订单有新动向 - %s,订单ID %s,合约代码 %s,开平方向 %s,订单方向 %s, 订单价格 %s,订单数量 %s,已成交数量 %s,未成交数量 %s,订单类型 %s,成交价格 %s,本次成交数量 %s,订单状态 %s,订单创建时间 %s,交易账户 %s,柜台返回的系统编号 %s'
%
(order.message, order.order_id, order.order_book_id, order.position_effect, order.side,
round
(order.price,
2
), order.quantity, order.filled_quantity, order.unfilled_quantity, order.
type
, order.trade_price, order.trade_quantity, order.status, order.datetime, order.account, order.system_id))
[backcolor
=
rgb(
255
,
255
,
255
)][font
=
Consolas, "][color
=
@classmethod
def
info(
cls
, context, msg):
print
(
'%s - INFO - %s'
%
(context.now, msg))
if
not
context.bool_if_first_log:
context.temp_log_list.append(msg)
return
logger
=
cls
().logger
logger.info(msg, extra
=
{
'key_time'
: context.now})