From 8c7b9a28d9673b077e14c7f71cd289bb95f71eac Mon Sep 17 00:00:00 2001 From: xxm Date: Thu, 20 Aug 2026 16:00:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(prompt):=20=E4=BF=AE=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=96=AD=E8=A3=82=E2=80=94=E2=80=94=E8=A1=8C=E4=B8=9A?= =?UTF-8?q?=E5=BC=BA=E5=BA=A6=E8=BF=9BLLM+=E7=A7=BB=E9=99=A4=E6=AD=BB?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - collect_data(): 从sector_snapshots读取行业涨跌/排名 - build_prompt(): 注入行业强度数据(行业涨跌%+排名) - 移除current_regime_strategies死数据(旧策略名不匹配strategy_defs) - 港股缺资金流(数据采集层限制,非代码问题) --- deploy/profile-scripts/batch_reassess.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/deploy/profile-scripts/batch_reassess.py b/deploy/profile-scripts/batch_reassess.py index bbc0d0ef..ae8924c5 100644 --- a/deploy/profile-scripts/batch_reassess.py +++ b/deploy/profile-scripts/batch_reassess.py @@ -178,6 +178,22 @@ def collect_data(code): _db2.close() except Exception: pass + + # 行业强度(sector_snapshots: market_watch.py 写入的板块涨跌排名) + try: + _db3 = sqlite3.connect(DB, timeout=30) + _sector = data.get("sector_context", "") + if _sector: + _ss = _db3.execute( + "SELECT change_pct, rank_in_market FROM sector_snapshots " + "WHERE sector_name LIKE ? ORDER BY date DESC LIMIT 1", + (f"%{_sector}%",)).fetchone() + if _ss: + data["sector_change_pct"] = _ss[0] if _ss[0] is not None else None + data["sector_rank"] = _ss[1] if _ss[1] is not None else None + _db3.close() + except Exception: + pass # 情势体检:温区 + 高风险消息 + 执行红线 _sit = {"regime_a": "unknown", "regime_7d_ago": "unknown", "high_risk": "", "breach_stop": "否", "reach_tp": "否", "out_zone": "否", "over_hold": "否"} @@ -632,7 +648,7 @@ accumulation(主力建仓) / b_td1_v3(超跌原池优选) / v_mr(弱市深超跌 大盘:{data.get('macro','震荡')}{_macro_label} 最新价:{data.get('price',0)} 涨跌:{data.get('change_pct','0')}%{_price_label} PE={data.get('pe','?')}(最新财报) 市值={data.get('mcap','?')}亿 -行业:{data.get('sector_context','?')}(近一个交易日) +行业:{data.get('sector_context','?')}(近一个交易日){_sector_extra} 技术面:{data.get('tech_snapshot','')[:300]}(MA=5/10/20/60日 支撑阻力=近20日 量价=当日+近5日趋势) {_tech_str} {_tech_str}