Harden strategy SoT: fail-closed funds gate, shared open pipeline, LIVE switch guards.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -164,6 +164,11 @@ class Matcher:
|
||||
) -> OpenResult:
|
||||
s = get_settings()
|
||||
pos = self.current_position()
|
||||
st = str(pos.get("status") or "flat")
|
||||
if st in BLOCKING_STATUSES and (
|
||||
st == "opening" or bool(pos.get("group_id") or pos.get("option_inst_id"))
|
||||
):
|
||||
return OpenResult(ok=False, detail=f"已有持仓状态({st}),请先平仓")
|
||||
if pos.get("status") == "open" and pos.get("group_id"):
|
||||
return OpenResult(ok=False, detail="已有持仓组,请先平仓")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user