@@ -15,13 +15,14 @@ class Order:
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" , "secret_key" ]
18+ "order_type" , "time_in_force" , "outside_rth" , "order_legs" , "algo_params" , "secret_key" , "liquidation" ,
19+ "algo_strategy" , "discount" ]
1920
2021 def __init__ (self , account , contract , action , order_type , quantity , limit_price = None , aux_price = None ,
2122 trail_stop_price = None , trailing_percent = None , percent_offset = None , time_in_force = None ,
2223 outside_rth = None , filled = 0 , avg_fill_price = 0 , commission = None , realized_pnl = None ,
2324 id = None , order_id = None , parent_id = None , order_time = None , trade_time = None , order_legs = None ,
24- algo_params = None , secret_key = None ):
25+ algo_params = None , secret_key = None , ** kwargs ):
2526 """
2627 - account: 订单所属的账户
2728 - id: 全局订单 id
@@ -50,6 +51,9 @@ def __init__(self, account, contract, action, order_type, quantity, limit_price=
5051 - order_legs: 附加订单列表
5152 - algo_params: 算法订单参数
5253 - secret_key: 机构交易员专有密钥
54+ - liquidation
55+ - algo_strategy
56+ - discount
5357 """
5458
5559 self .id = id
@@ -79,6 +83,9 @@ def __init__(self, account, contract, action, order_type, quantity, limit_price=
7983 self .order_legs = order_legs
8084 self .algo_params = algo_params
8185 self .secret_key = secret_key
86+ self .liquidation = kwargs .get ('liquidation' )
87+ self .algo_strategy = kwargs .get ('algo_strategy' )
88+ self .discount = kwargs .get ('discount' )
8289
8390 def to_dict (self ):
8491 dct = {name : getattr (self , name ) for name in self .__slots__ if name not in ORDER_FIELDS_TO_IGNORE }
0 commit comments