From 03c5f9e202d0fb837417a1b5298b0887b0d72a5e Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 17 Aug 2026 10:48:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20pool=5Fnews=E9=87=87=E9=9B=86=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E9=99=84=E5=BD=93=E5=89=8D=E7=AD=96=E7=95=A5=E5=BF=AB?= =?UTF-8?q?=E7=85=A7(=E7=89=88=E6=9C=AC/=E9=87=8D=E8=AF=84=E6=97=B6?= =?UTF-8?q?=E9=97=B4/=E6=AD=A2=E6=8D=9F/=E6=AD=A2=E7=9B=88/=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7/=E6=93=8D=E4=BD=9C)=E2=80=94=E2=80=94=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=E5=BF=85=E9=A1=BB=E5=BC=95=E7=94=A8=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/pool_news_collector.py | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/deploy/profile-scripts/pool_news_collector.py b/deploy/profile-scripts/pool_news_collector.py index 8c84ae38..c4ed4e80 100644 --- a/deploy/profile-scripts/pool_news_collector.py +++ b/deploy/profile-scripts/pool_news_collector.py @@ -94,9 +94,34 @@ def main(): time.sleep(SLEEP) conn.commit() - conn.close() dt = time.time() - t0 print(f"[{tag}] 完成: {ok}/{len(codes)} 成功, {empty} 无新闻, {fail} 失败, 新增 {new} 条, 耗时 {dt:.0f}s", flush=True) + # ── 2026-08-17 老莫:推荐必须带所依据的策略 ── + # 打印池子内每只股票的当前策略快照(SSOT:holding_strategies 最新记录) + # 知微执行本 job 时据此引用真实策略(版本/重评时间/止损/止盈/买入区/信号/操作), + # 不得凭 strategy_history 旧快照或记忆自由发挥。 + print("\n===== 当前策略快照(推荐必须引用以下真实策略) =====", flush=True) + try: + _cols = [d[1] for d in conn.execute("PRAGMA table_info(holding_strategies)").fetchall()] + for _code in codes: + _r = conn.execute( + "SELECT * FROM holding_strategies WHERE code=? AND status='active' ORDER BY rowid DESC LIMIT 1", + (_code,)).fetchone() + if not _r: + continue + _d = dict(zip(_cols, _r)) + _sig = _d.get("timing_signal") or "?" + _sl = _d.get("stop_loss"); _tp = _d.get("take_profit") + _el = _d.get("entry_low"); _eh = _d.get("entry_high") + _ver = _d.get("version") or _d.get("decision_type") or "?" + _ra = (_d.get("reassessed_at") or _d.get("updated_at") or "")[:19] + _act = str(_d.get("action") or "")[:120] + print(f"[策略] {_code} {_d.get('name','')} | 版本={_ver} 重评={_ra} | " + f"信号={_sig} 止损={_sl} 止盈={_tp} 买入区={_el}~{_eh} | 操作: {_act}", flush=True) + print("===== 策略快照结束 =====", flush=True) + except Exception as _e: + print(f"[策略快照输出失败] {_e}", file=sys.stderr) + conn.close() if __name__ == "__main__":