diff --git a/deploy/profile-scripts/strategy_lifecycle.py b/deploy/profile-scripts/strategy_lifecycle.py index b0f0867e..0df31036 100644 --- a/deploy/profile-scripts/strategy_lifecycle.py +++ b/deploy/profile-scripts/strategy_lifecycle.py @@ -1452,7 +1452,14 @@ def reassess_strategy(code, name, price, cost, shares, current_action, # ----- 构造 action 描述(供 cron prompt 使用) ----- action_parts = [] - if profit_pct < -20: + # 非持仓(自选股/未持有,shares=0):盈亏标签无意义——cost=0 → profit_pct=0 → + # 永远掉进"盈利持有",空仓股票显示"盈利持有"自相矛盾(2026-07-23 老爸抓包601998) + if not shares or is_watchlist: + if any(s in timing_signal for s in ("买入", "加仓", "可追")): + action_parts.append("空仓·可建仓") + else: + action_parts.append("空仓关注") + elif profit_pct < -20: action_parts.append("深套持有") elif profit_pct < -10: action_parts.append("持有观察") @@ -2173,7 +2180,11 @@ def regenerate_all(stdout=True): # 重建 action 文本(引用手动参数,不引用自动计算的) profit_pct = (price - cost) / cost * 100 if cost else 0 manual_action_parts = [] - if profit_pct < -20: + # 非持仓:同1455行修复,空仓不显示盈亏标签 + if not shares or is_wl: + _ts0 = result.get("timing_signal", "") + manual_action_parts.append("空仓·可建仓" if any(s in _ts0 for s in ("买入","加仓","可追")) else "空仓关注") + elif profit_pct < -20: manual_action_parts.append("深套持有") elif profit_pct < -10: manual_action_parts.append("持有观察")