Skip to content

Commit 8acf0aa

Browse files
committed
order update time
1 parent 3b2e5d3 commit 8acf0aa

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

tigeropen/push/push_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
'latestTime': 'trade_time', 'contractId': 'contract_id', 'trailStopPrice': 'trail_stop_price',
6464
'trailingPercent': 'trailing_percent', 'percentOffset': 'percent_offset', 'action': 'action',
6565
'status': 'status', 'currency': 'currency', 'remaining': 'remaining', 'id': 'id',
66-
'segment': 'segment', 'identifier': 'identifier', 'replaceStatus': 'replace_status'}
66+
'segment': 'segment', 'identifier': 'identifier', 'replaceStatus': 'replace_status',
67+
'updateTime': 'update_time'}
6768

6869
if sys.platform == 'linux' or sys.platform == 'linux2':
6970
KEEPALIVE = True

tigeropen/trade/domain/order.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class Order:
1616
"quantity", "filled", "_remaining", "avg_fill_price", "commission", "realized_pnl", "_status",
1717
"trail_stop_price", "limit_price", "aux_price", "trailing_percent", "percent_offset", "action",
1818
"order_type", "time_in_force", "outside_rth", "order_legs", "algo_params", "algo_strategy",
19-
"secret_key", "liquidation", "discount", "attr_desc", "source", 'adjust_limit', 'sub_ids', "user_mark"]
19+
"secret_key", "liquidation", "discount", "attr_desc", "source", 'adjust_limit', 'sub_ids', "user_mark",
20+
"update_time"]
2021

2122
def __init__(self, account, contract, action, order_type, quantity, limit_price=None, aux_price=None,
2223
trail_stop_price=None, trailing_percent=None, percent_offset=None, time_in_force=None,
@@ -31,6 +32,7 @@ def __init__(self, account, contract, action, order_type, quantity, limit_price=
3132
- order_time: 下单时间
3233
- reason: 下单失败时, 会返回失败原因的描述
3334
- trade_time: 最新成交时间
35+
- update_time: order updated time
3436
- action: 交易方向, 'BUY' / 'SELL'
3537
- quantity: 下单数量
3638
- filled: 成交数量
@@ -84,6 +86,7 @@ def __init__(self, account, contract, action, order_type, quantity, limit_price=
8486
self.percent_offset = percent_offset
8587
self.order_time = order_time
8688
self.trade_time = trade_time
89+
self.order_time = kwargs.get('update_time')
8790
self.order_legs = order_legs
8891
self.algo_params = algo_params
8992
self.secret_key = secret_key

tigeropen/trade/response/orders_response.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'contractId': 'contract_id', 'algoStrategy': 'algo_strategy',
2323
'trailStopPrice': 'trail_stop_price', 'trailingPercent': 'trailing_percent',
2424
'percentOffset': 'percent_offset', 'identifier': 'identifier', 'algoParameters': 'algo_params',
25-
'userMark': 'user_mark'
25+
'userMark': 'user_mark', 'updateTime': 'update_time'
2626
}
2727

2828

@@ -115,6 +115,8 @@ def parse_order(item, secret_key=None):
115115
order.order_time = order_fields.get('order_time')
116116
if 'trade_time' in order_fields:
117117
order.trade_time = order_fields.get('trade_time')
118+
if 'update_time' in order_fields:
119+
order.update_time = order_fields.get('update_time')
118120
if 'reason' in order_fields:
119121
order.reason = order_fields.get('reason')
120122
if secret_key is not None:

0 commit comments

Comments
 (0)