From 6d5b71eb3d1fe38213974cc5a95e96a49235cc88 Mon Sep 17 00:00:00 2001 From: dekun Date: Sat, 3 Oct 2026 02:23:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E6=9D=A1=E4=BB=B6=E5=8D=95?= =?UTF-8?q?=E6=8C=89=E6=96=B9=E5=90=91=E7=BB=91=E5=AE=9A=E7=A9=BF=E8=B6=8A?= =?UTF-8?q?=EF=BC=9A=E7=9C=8B=E8=B7=8C=E4=B8=8A=E7=A9=BF=E3=80=81=E7=9C=8B?= =?UTF-8?q?=E6=B6=A8=E4=B8=8B=E7=A9=BF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- lib/options/options_cond_order_lib.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/options/options_cond_order_lib.py b/lib/options/options_cond_order_lib.py index 80e8080..b2dc2c2 100644 --- a/lib/options/options_cond_order_lib.py +++ b/lib/options/options_cond_order_lib.py @@ -154,9 +154,8 @@ def create_cond_order(conn: sqlite3.Connection, payload: dict[str, Any]) -> dict opt_type = (payload.get("opt_type") or "P").strip().upper() if opt_type not in ("P", "C"): return {"ok": False, "msg": "opt_type 须为 P 或 C"} - trigger_side = (payload.get("trigger_side") or "gte").strip().lower() - if trigger_side not in ("gte", "lte"): - return {"ok": False, "msg": "trigger_side 须为 gte 或 lte"} + # 左侧单:看跌等上穿、看涨等下穿;忽略中控传入的 trigger_side + trigger_side = "gte" if opt_type == "P" else "lte" trigger_px = _safe_float(payload.get("trigger_px")) if trigger_px is None or trigger_px <= 0: return {"ok": False, "msg": "trigger_px 无效"}