flet v2
This commit is contained in:
+5
-5
@@ -327,11 +327,11 @@ class QmtApp:
|
||||
def _pending_tags(self, stock_code: str) -> list:
|
||||
"""返回该标的下挂单的方向标签列表:'多'(买单) / '空'(卖单)"""
|
||||
tags = []
|
||||
_CANCELED = {54, 57}
|
||||
_TERMINAL = {54, 56, 57}
|
||||
for o in self._orders:
|
||||
if _plain(getattr(o, 'stock_code', '')) != stock_code:
|
||||
continue
|
||||
if getattr(o, 'order_status', 0) in _CANCELED:
|
||||
if getattr(o, 'order_status', 0) in _TERMINAL:
|
||||
continue
|
||||
ot = getattr(o, 'order_type', 0)
|
||||
if ot == 23 and '多' not in tags:
|
||||
@@ -533,8 +533,8 @@ class QmtApp:
|
||||
self._sel_actions.controls = []
|
||||
self._uncl_list.controls = [self._build_unclassified_table()]
|
||||
|
||||
# 委托 — 过滤已撤/废单,按 order_id 去重(保留最后一条即最新状态)
|
||||
_CANCELED = {54, 57}
|
||||
# 委托 — 过滤已终结订单(已撤/已成/废单),按 order_id 去重
|
||||
_TERMINAL = {54, 56, 57}
|
||||
o_map = {} # order_id → latest order
|
||||
for o in self._orders:
|
||||
oid = str(getattr(o, 'order_id', ''))
|
||||
@@ -544,7 +544,7 @@ class QmtApp:
|
||||
o_rows = []
|
||||
for o in o_map.values():
|
||||
st = getattr(o, 'order_status', 0)
|
||||
if st in _CANCELED:
|
||||
if st in _TERMINAL:
|
||||
continue
|
||||
tv = getattr(o, 'traded_volume', 0) or 0
|
||||
ov = getattr(o, 'order_volume', 0) or 0
|
||||
|
||||
Reference in New Issue
Block a user