diff --git a/lib/common/static/hedge_plan.js b/lib/common/static/hedge_plan.js index 7eace0d..7abe93b 100644 --- a/lib/common/static/hedge_plan.js +++ b/lib/common/static/hedge_plan.js @@ -149,6 +149,18 @@ return fmt(v, 2) + ":1"; } + function optionPrimaryLevOk(c, moneyKind) { + const idx = indexPx(); + const ask = Number(c && c.ask); + if (!(idx > 0) || !(ask > 0)) return true; + const kind = moneyKind || opMoneyKind(); + // 方案:杠杆门主要卡虚值;实/平列表不过滤,选用/启动再校验 + if (kind !== "otm") return true; + const minLev = numInput("hp-opt-leverage", 200); + const levFloor = Math.max(minLev, 180); + return idx / ask >= levFloor; + } + function matchesMoneyFilter(c) { const f = state.moneyFilter || "itm"; const m = (c.moneyness || "").toLowerCase(); @@ -159,10 +171,9 @@ if (idx && interval > 0 && Math.abs(Number(c.strike) - idx) > interval + 1e-9) { return false; } - const ask = Number(c.ask || 0); - const minLev = numInput("hp-opt-leverage", f === "otm" ? 200 : 100); - const levFloor = f === "otm" ? Math.max(minLev, 180) : minLev; - if (idx && ask > 0 && levFloor > 0 && idx / ask < levFloor) return false; + if (!optionPrimaryLevOk(c, f === "otm" ? "otm" : f === "atm" ? "atm" : "itm")) { + return false; + } } if (f === "itm") return m === "itm" || m === "atm"; if (f === "atm") return m === "atm"; @@ -1122,11 +1133,32 @@ tbody.innerHTML = '