From 5e1ae075e3b07e8bb14dbc298fb142f75454f9c8 Mon Sep 17 00:00:00 2001 From: baobao Date: Wed, 28 Oct 2026 10:49:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E9=98=88=E5=80=BC=E5=8F=98?= =?UTF-8?q?=E8=89=B2=E6=9F=B1=E5=9B=BE=E5=B9=B6=E5=8C=BA=E5=88=86=E5=BE=85?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=8C=87=E4=BB=A4=E4=B8=8E=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E5=A7=94=E6=89=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/execution_conflicts.py | 18 ++++- app/web/static/index.html | 110 +++++++++++++--------------- scripts/run_tests.py | 2 +- scripts/test_batch41_units.py | 25 +++++++ 4 files changed, 93 insertions(+), 62 deletions(-) diff --git a/app/services/execution_conflicts.py b/app/services/execution_conflicts.py index 7b3362b..a5da2d8 100644 --- a/app/services/execution_conflicts.py +++ b/app/services/execution_conflicts.py @@ -105,29 +105,45 @@ def instruction_progress(rows): continue if not ws: row['execution_label'] = '影子执行待核对' + row['execution_stage'] = 'shadow' continue try: orders = qmt_repo.orders_for_parent(row['instruction_id']) active = [o for o in orders if o.get('status') in qmt_repo.LIVE] + stage = 'waiting' if any(o.get('cancel_state') in ('REQUESTED', 'SENT') for o in active): label = '撤单处理中' + stage = 'cancelling' elif any(o.get('status') not in ('QUEUED', 'SENDING') for o in active): label = '委托待成交' + stage = 'submitted' elif active: label = '委托待发送' + stage = 'sending' if any(o.get('status') == 'SENDING' for o in active) else 'queued' else: - reason = ((row.get('progress') or {}).get('last_decision') or {}).get('reason') or '' + decision = (row.get('progress') or {}).get('last_decision') or {} + reason = decision.get('reason') or '' if row.get('status') == 'CANCELLED': label = '已撤销' + stage = 'ended' + elif sum(int(o.get('cum_qty') or 0) for o in orders) >= int(row.get('qty') or 1): + label = '成交待入账' + stage = 'reconciling' elif '可卖量不足' in reason: label = '等待可卖' elif '当日配额' in reason: label = '等待下一批' elif '暂停买入' in reason: label = '买入已暂停' + elif decision.get('action') == 'REJECT': + label = '执行检查未通过' + elif decision.get('action') in ('WAIT', 'SKIP', 'STOP'): + label = '等待买入条件' if row.get('side') == 'buy' else '等待卖出条件' else: label = '等待执行' row['execution_label'] = label + row['execution_stage'] = stage except Exception: row['execution_label'] = '委托状态待核实' + row['execution_stage'] = 'unknown' return rows diff --git a/app/web/static/index.html b/app/web/static/index.html index 5c5d3c6..9005273 100644 --- a/app/web/static/index.html +++ b/app/web/static/index.html @@ -43,7 +43,7 @@ body{margin:0;background:var(--plane);color:var(--ink); .hst.entry{background:var(--up-weak);color:var(--up);} .hst.exit{background:var(--down-weak);color:var(--down);} .hst.missing{background:transparent;color:var(--muted);outline:1px dashed var(--muted);outline-offset:-1px;} -.market-popover{width:min(440px,calc(100vw - 44px));font-size:12px;line-height:1.5;} +.market-popover{width:min(360px,calc(100vw - 44px));font-size:12px;line-height:1.5;} .market-popover .trend-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:5px;} .market-popover .trend-heading b{font-size:13px;} .market-popover .trend-value{font-size:19px;font-weight:650;} @@ -605,17 +605,14 @@ body.dock-r:not(.r-fold) .side-r .strip{display:none;}
执行值 {{ microNumber(mzSig.value) }}发布值 {{ mzPublished.ready ? microNumber(mzPublished.value) : '待核实' }}
数据 {{ mzDate(mzSig.data_ymd) }}发布 {{ mzPublished.ready ? mzDate(mzPublished.data_ymd) : '未知' }}
-
{{ line.name }}
- - {{ tick.label }} - - - {{ point.text }} - {{ chart.first }}{{ chart.middle }}{{ chart.last }} + + + {{ bar.text }} + {{ chart.first }}{{ chart.last }}
暂无有效趋势数据
-
冷 {{ (macro.params||{}).cold_th }} · 热 +{{ (macro.params||{}).hot_th }} · 退出 ±{{ (macro.params||{}).exit_band }} · 两值有差异,按执行值择时
+
冷 < {{ (macro.params||{}).cold_th }} · 热 > +{{ (macro.params||{}).hot_th }} · 两值有差异,按执行值择时
偏热,自动买入暂停
{{ mzSig.advice.direction==='REDUCE' ? '降仓' : '升仓' }}建议 {{ (mzSig.advice.pct*100).toFixed(1) }}%
@@ -633,18 +630,15 @@ body.dock-r:not(.r-fold) .side-r .strip{display:none;}
{{ microError }}
{{ chart.title }}{{ chart.current }}
-
{{ line.name }}
- - {{ tick.label }} - - - {{ point.text }} - {{ chart.first }}{{ chart.middle }}{{ chart.last }} + + + {{ bar.text }} + {{ chart.first }}{{ chart.last }}
暂无有效趋势数据
{{ microHistoryError }}
-
低于5%入场 · 高于95%退出 · 成长瓦解 {{ microReady ? microSignal.growth_break ? '已触发' : '未触发' : '待核实' }}
+
低于5%入场 · 高于95%退出 · 成长瓦解 {{ microReady ? microSignal.growth_break ? '已触发' : '未触发' : '待核实' }}
历史按当前数据计算策略详情 →
@@ -722,7 +716,7 @@ body.dock-r:not(.r-fold) .side-r .strip{display:none;}