feat: 港股板块指数全量拓展——EM所属行业覆盖253只(50个行业)+自建板块指数137个,sector_slope因子对港股全量生效

This commit is contained in:
hmo
2026-07-29 11:45:22 +08:00
parent a1090c17e0
commit dfdd7490f2
+2 -2
View File
@@ -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()