fix: parse_response买入区0.0~0.0视为zone_cleared——清空脏值不再残留

This commit is contained in:
xxm
2026-08-18 11:03:24 +08:00
parent 9543dd52e8
commit 31f3da772d
+6
View File
@@ -458,6 +458,12 @@ def parse_response(text):
if zl:
if re.search(r'\s*(无|不设|不参与|空仓)', zl):
result["zone_cleared"] = True
else:
# 2026-08-18 修复:LLM 输出"买入区0.0~0.0"也视为 zone_cleared(清空)
# 否则 parse 得 0/0 → 区间条件不成立 → 旧脏值(如95/99)残留(600262 教训)
_zero_nums = re.findall(r'\d+\.?\d*', zl)
if len(_zero_nums) >= 2 and all(float(n) <= 0.01 for n in _zero_nums[:2]):
result["zone_cleared"] = True
else:
# 2026-08-18 修复:LLM 说"95~99(异常,应为14.87~15.01"时,取"应为"后的正确区间
# 否则取前两个数字(避免旧脏值被当推荐值写回,老莫 600262 教训)