@@ -15,13 +15,13 @@ class Order(object):
1515 __slots__ = ["account" , "id" , "order_id" , "parent_id" , "order_time" , "reason" , "trade_time" , "contract" , "action" ,
1616 "quantity" , "filled" , "_remaining" , "avg_fill_price" , "commission" , "realized_pnl" , "_status" ,
1717 "trail_stop_price" , "limit_price" , "aux_price" , "trailing_percent" , "percent_offset" , "action" ,
18- "order_type" , "time_in_force" , "outside_rth" , "order_legs" , "algo_params" ]
18+ "order_type" , "time_in_force" , "outside_rth" , "order_legs" , "algo_params" , "secret_key" ]
1919
2020 def __init__ (self , account , contract , action , order_type , quantity , limit_price = None , aux_price = None ,
2121 trail_stop_price = None , trailing_percent = None , percent_offset = None , time_in_force = None ,
2222 outside_rth = None , filled = 0 , avg_fill_price = 0 , commission = None , realized_pnl = None ,
2323 id = None , order_id = None , parent_id = None , order_time = None , trade_time = None , order_legs = None ,
24- algo_params = None ):
24+ algo_params = None , secret_key = None ):
2525 """
2626 - account: 订单所属的账户
2727 - id: 全局订单 id
@@ -49,6 +49,7 @@ def __init__(self, account, contract, action, order_type, quantity, limit_price=
4949 - remaining: 未成交的数量
5050 - order_legs: 附加订单列表
5151 - algo_params: 算法订单参数
52+ - secret_key: 机构交易员专有密钥
5253 """
5354
5455 self .id = id
@@ -77,6 +78,7 @@ def __init__(self, account, contract, action, order_type, quantity, limit_price=
7778 self .trade_time = trade_time
7879 self .order_legs = order_legs
7980 self .algo_params = algo_params
81+ self .secret_key = secret_key
8082
8183 def to_dict (self ):
8284 dct = {name : getattr (self , name ) for name in self .__slots__ if name not in ORDER_FIELDS_TO_IGNORE }
0 commit comments