From dfdd7490f2082ff3f1b7023e8112cba2379a98d7 Mon Sep 17 00:00:00 2001 From: hmo Date: Wed, 29 Jul 2026 11:45:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B8=AF=E8=82=A1=E6=9D=BF=E5=9D=97?= =?UTF-8?q?=E6=8C=87=E6=95=B0=E5=85=A8=E9=87=8F=E6=8B=93=E5=B1=95=E2=80=94?= =?UTF-8?q?=E2=80=94EM=E6=89=80=E5=B1=9E=E8=A1=8C=E4=B8=9A=E8=A6=86?= =?UTF-8?q?=E7=9B=96253=E5=8F=AA(50=E4=B8=AA=E8=A1=8C=E4=B8=9A)+=E8=87=AA?= =?UTF-8?q?=E5=BB=BA=E6=9D=BF=E5=9D=97=E6=8C=87=E6=95=B0137=E4=B8=AA?= =?UTF-8?q?=EF=BC=8Csector=5Fslope=E5=9B=A0=E5=AD=90=E5=AF=B9=E6=B8=AF?= =?UTF-8?q?=E8=82=A1=E5=85=A8=E9=87=8F=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- strategy_lab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strategy_lab.py b/strategy_lab.py index 009cbadf..dcf22a89 100644 --- a/strategy_lab.py +++ b/strategy_lab.py @@ -391,7 +391,7 @@ def prepare_sector_context(start_date, end_date): e['inflow'] = round(inflow or 0, 1) if 'change' not in e or e.get('change') is None: e['change'] = round(chg or 0, 2) - # 3. 个股→行业映射:优先 EM 体系(覆盖全,与 sector_index_daily 对齐),THS 兜底 + # 3. 个股→行业映射:优先 EM 体系(覆盖全,与 sector_index_daily 对齐),THS/港股体系兜底 try: for code, sec in conn.execute("SELECT code, sector FROM stock_sectors_em").fetchall(): _STOCK_SECTOR[code] = sec @@ -399,7 +399,7 @@ def prepare_sector_context(start_date, end_date): pass for code, sec, src in conn.execute( "SELECT code, sector_name, source FROM stock_sectors").fetchall(): - if code not in _STOCK_SECTOR and src == 'ths': + if code not in _STOCK_SECTOR and src in ('ths', 'hk_em', 'hk_manual'): _STOCK_SECTOR[code] = sec finally: conn.close()