From 4736b64eca9e13695fe663002bbb5ed079240906 Mon Sep 17 00:00:00 2001 From: aszerW Date: Mon, 8 Jun 2026 00:55:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(report):=20=E5=85=A8=E6=A0=87=E7=9A=84?= =?UTF-8?q?=E6=8E=92=E5=90=8D=E8=A1=A8=E6=96=B0=E5=A2=9E=E8=BF=9B=E5=9C=BA?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在状态和持有天数之间插入进场日期列,显示持仓标的的连续持仓起始日期(YYYY-MM-DD格式),调出/未入选标的显示— --- rotation/simple_rotation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rotation/simple_rotation.py b/rotation/simple_rotation.py index d495cad..94157be 100644 --- a/rotation/simple_rotation.py +++ b/rotation/simple_rotation.py @@ -1327,7 +1327,7 @@ class SimpleRotationStrategy: rank_map = {c: i + 1 for i, c in enumerate(ranked_all)} col_labels = ["排名", "标的名称", "市场", "指数代码", "ETF代码", "仓位", "得分", - "指数最新价", "ETF收盘价", "溢价率", "状态", "持有天数", "盈亏"] + "指数最新价", "ETF收盘价", "溢价率", "状态", "进场日期", "持有天数", "盈亏"] table_data = [] row_actions = [] # track action for coloring @@ -1339,13 +1339,14 @@ class SimpleRotationStrategy: idx_s = f"{p['idx_close']:.2f}" if p['idx_close'] is not None else "—" etf_s = f"{p['etf_close']:.3f}" if p['etf_close'] is not None else "—" prem_s = f"{p['premium']:+.2%}" if p['premium'] is not None else "—" + entry_date_s = p['entry_date'].strftime('%Y-%m-%d') if p['entry_date'] else "—" days_s = str(p['holding_days']) if p['holding_days'] > 0 else "—" pnl_s = f"{p['pnl']:+.2%}" if p['pnl'] is not None else "—" weight_s = f"{p['weight']:.0%}" if p['weight'] > 0 else "—" market = code_config.get(p['code'], {}).get('market', '—') table_data.append([ rank, p['name'], market, p['code'], p['etf'], weight_s, - score_s, idx_s, etf_s, prem_s, p['action'], days_s, pnl_s + score_s, idx_s, etf_s, prem_s, p['action'], entry_date_s, days_s, pnl_s ]) row_actions.append(p['action'])