fix: 修正突破加仓当前价与突破价的几何校验

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-26 23:34:59 +08:00
parent be8e4ce6c6
commit 9cb63c368a
2 changed files with 47 additions and 5 deletions
+4 -4
View File
@@ -266,13 +266,13 @@ def validate_roll_geometry(
if direction == "long":
if sl >= bp:
return "做多:止损须低于突破价"
if mark_price is not None and float(mark_price) <= bp:
return "做多:当前价须于突破价(等待向上突破)"
if mark_price is not None and float(mark_price) >= bp:
return "做多:当前价须于突破价(等待向上突破)"
else:
if sl <= bp:
return "做空:止损须高于突破价"
if mark_price is not None and float(mark_price) >= bp:
return "做空:当前价须于突破价(等待向下破)"
if mark_price is not None and float(mark_price) <= bp:
return "做空:当前价须于突破价(等待向下破)"
else:
return "加仓方式无效"