From 9899be4bcdd39d37a4f175882e504dbd6af66fb3 Mon Sep 17 00:00:00 2001 From: xxm Date: Thu, 20 Aug 2026 16:18:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(prompt):=20=E4=BF=AE=E5=A4=8Dstock=5Findica?= =?UTF-8?q?tors=E6=9F=A5=E8=AF=A2=E2=80=94=E7=A7=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84bias20=E5=88=97,=E8=A1=A5dist=5Fma20?= =?UTF-8?q?/vol=5Fratio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/batch_reassess.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/deploy/profile-scripts/batch_reassess.py b/deploy/profile-scripts/batch_reassess.py index 4ae4939f..32251298 100644 --- a/deploy/profile-scripts/batch_reassess.py +++ b/deploy/profile-scripts/batch_reassess.py @@ -165,16 +165,17 @@ def collect_data(code): pass try: _db2 = sqlite3.connect(DB, timeout=30) - _fi = _db2.execute("SELECT mcap_q, pe_q, bias60, bias20, rsi, r5f, dist_lo20 FROM stock_indicators WHERE code=? ORDER BY date DESC LIMIT 1", (code,)).fetchone() + _fi = _db2.execute("SELECT mcap_q, pe_q, bias60, rsi, r5f, dist_lo20, dist_ma20, vol_ratio FROM stock_indicators WHERE code=? ORDER BY date DESC LIMIT 1", (code,)).fetchone() if _fi: data["factor_mcap_q"] = _fi[0] if _fi[0] is not None else None data["factor_pe_q"] = _fi[1] if _fi[1] is not None else None data["factor_bias60"] = _fi[2] if _fi[2] is not None else None - data["factor_bias20"] = _fi[3] if _fi[3] is not None else None - if data.get("ta_rsi") is None and _fi[4] is not None: - data["ta_rsi"] = round(_fi[4], 1) - data["factor_ret5d"] = _fi[5] if _fi[5] is not None else None - data["factor_dist_lo20"] = _fi[6] if _fi[6] is not None else None + if data.get("ta_rsi") is None and _fi[3] is not None: + data["ta_rsi"] = round(_fi[3], 1) + data["factor_ret5d"] = _fi[4] if _fi[4] is not None else None + data["factor_dist_lo20"] = _fi[5] if _fi[5] is not None else None + data["factor_dist_ma20"] = _fi[6] if _fi[6] is not None else None + data["factor_vol_ratio"] = _fi[7] if _fi[7] is not None else None _db2.close() except Exception: pass @@ -475,7 +476,7 @@ def build_prompt(data): if data.get("mtf_monthly_trend"): _tech_parts.append(f"月线={data['mtf_monthly_trend']}") _factor_parts = [] - for _fk, _fl in [("factor_mcap_q", "市值分位"), ("factor_pe_q", "PE分位"), ("factor_bias60", "bias60"), ("factor_bias20", "bias20"), ("factor_ret5d", "5日涨幅"), ("factor_dist_lo20", "距20日低点")]: + for _fk, _fl in [("factor_mcap_q", "市值分位"), ("factor_pe_q", "PE分位"), ("factor_bias60", "bias60"), ("factor_ret5d", "5日涨幅"), ("factor_dist_lo20", "距20日低点"), ("factor_dist_ma20", "距MA20"), ("factor_vol_ratio", "量比")]: if data.get(_fk) is not None: _factor_parts.append(f"{_fl}={data[_fk]}") if _factor_parts: