|
11 | 11 | ALGO_PARAMS_TAG_MAP = {'noTakeLiq': 'no_take_liq', 'startTime': 'start_time', 'endTime': 'end_time', |
12 | 12 | 'participationRate': 'participation_rate', 'allowPastEndTime': 'allow_past_end_time'} |
13 | 13 |
|
| 14 | + |
14 | 15 | class Order(object): |
15 | 16 | __slots__ = ["account", "id", "order_id", "parent_id", "order_time", "reason", "trade_time", "contract", "action", |
16 | 17 | "quantity", "filled", "_remaining", "avg_fill_price", "commission", "realized_pnl", "_status", |
17 | 18 | "trail_stop_price", "limit_price", "aux_price", "trailing_percent", "percent_offset", "action", |
18 | | - "order_type", "time_in_force", "outside_rth", "order_legs", "algo_params"] |
| 19 | + "order_type", "time_in_force", "outside_rth", "order_legs", "algo_params", "secret_key"] |
19 | 20 |
|
20 | 21 | def __init__(self, account, contract, action, order_type, quantity, limit_price=None, aux_price=None, |
21 | 22 | trail_stop_price=None, trailing_percent=None, percent_offset=None, time_in_force=None, |
22 | 23 | outside_rth=None, filled=0, avg_fill_price=0, commission=None, realized_pnl=None, |
23 | 24 | id=None, order_id=None, parent_id=None, order_time=None, trade_time=None, order_legs=None, |
24 | | - algo_params=None): |
| 25 | + algo_params=None, secret_key=None): |
25 | 26 | """ |
26 | 27 | - account: 订单所属的账户 |
27 | 28 | - id: 全局订单 id |
@@ -49,6 +50,7 @@ def __init__(self, account, contract, action, order_type, quantity, limit_price= |
49 | 50 | - remaining: 未成交的数量 |
50 | 51 | - order_legs: 附加订单列表 |
51 | 52 | - algo_params: 算法订单参数 |
| 53 | + - secret_key: 机构交易员专有密钥 |
52 | 54 | """ |
53 | 55 |
|
54 | 56 | self.id = id |
@@ -77,6 +79,7 @@ def __init__(self, account, contract, action, order_type, quantity, limit_price= |
77 | 79 | self.trade_time = trade_time |
78 | 80 | self.order_legs = order_legs |
79 | 81 | self.algo_params = algo_params |
| 82 | + self.secret_key = secret_key |
80 | 83 |
|
81 | 84 | def to_dict(self): |
82 | 85 | dct = {name: getattr(self, name) for name in self.__slots__ if name not in ORDER_FIELDS_TO_IGNORE} |
|
0 commit comments