fix: 换仓建议f-string嵌套引号语法错误(已部署版本必现,紧急修复)

This commit is contained in:
hmo
2026-07-22 11:02:43 +08:00
parent 294133d605
commit b92a8cb666
+5 -4
View File
@@ -1284,10 +1284,11 @@ def flush_rec_digest(max_items=5):
plan.append(w)
freed += w["position_pct"] or 0
q0 = queued[0][0]
rotation_note = (f"🔄 换仓建议:现金不足买 {q0.get('name') or q0['code']}RR={q0.get('rr') or 0})→ "
f"可减 {'+'.join(f\"{w['name']}\" for w in plan)}"
f"{','.join(sorted({w['timing_signal'] for w in plan}))}"
f"腾出≈{freed:.0f}%仓位)换入")
_names = "+".join(str(w['name']) for w in plan)
_sigs = ",".join(sorted({w['timing_signal'] for w in plan}))
rotation_note = ("🔄 换仓建议:现金不足买 " + str(q0.get('name') or q0['code'])
+ f"RR={q0.get('rr') or 0})→ 可减 {_names}"
+ f"{_sigs},腾出≈{freed:.0f}%仓位)换入")
conn.close()
except Exception as _re:
print(f" [REC] 换仓计算异常: {_re}", flush=True)