This commit is contained in:
2026-06-16 11:07:09 +08:00
parent 2d8a0c3bca
commit 2e3202968d
4 changed files with 223 additions and 57 deletions
+5 -5
View File
@@ -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