Add fixed-direction switch for perp/option open side.

When enabled, lock perp long→buy Put or short→buy Call with ITM/ATM only; off keeps ATM/ask rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 19:18:12 +08:00
parent 55109e82d3
commit 0ee1d8be5d
16 changed files with 427 additions and 46 deletions
+20 -8
View File
@@ -130,9 +130,13 @@ export default function PlanPage() {
const bias = snap?.ask_compare?.bias;
const biasTag =
bias === "strike_below_spot" || bias === "call_ask_gt_put" ? (
bias === "strike_below_spot" ||
bias === "call_ask_gt_put" ||
bias === "fixed_short_call" ? (
<span className="tag up"> Call + </span>
) : bias === "strike_above_spot" || bias === "put_ask_gt_call" ? (
) : bias === "strike_above_spot" ||
bias === "put_ask_gt_call" ||
bias === "fixed_long_put" ? (
<span className="tag down"> Put + </span>
) : (
<span className="tag"> / </span>
@@ -149,9 +153,13 @@ export default function PlanPage() {
? `权利金×${fmt(plan?.premium_exit_multiple ?? 1, 2)}`
: `固定 ${fmt(plan?.net_profit_target ?? 15)} U`;
const phaseLabel = PHASE_ZH[plan?.phase || ""] || plan?.phase || "—";
const atmRule = plan?.atm_open_offset_enabled
? `ATM偏差≤${fmt(plan?.max_atm_open_offset ?? 3, 0)}`
: "ATM偏差关";
const atmRule = plan?.fixed_direction_enabled
? plan?.fixed_perp_side === "short"
? "固定:永续空+买Call(实/平)"
: "固定:永续多+买Put(实/平)"
: plan?.atm_open_offset_enabled
? `ATM偏差≤${fmt(plan?.max_atm_open_offset ?? 3, 0)}`
: "ATM偏差关";
const exitDetail =
exitMode === "premium_multiple"
? `净盈利≥初始权利金×${fmt(plan?.premium_exit_multiple ?? 1, 2)}`
@@ -337,9 +345,13 @@ export default function PlanPage() {
<span className="mono">
{fmt(plan?.min_option_hours, 0)}h ·
{fmt(plan?.min_option_leverage, 0)}x
{plan?.atm_open_offset_enabled
? ` · ATM偏差≤${fmt(plan?.max_atm_open_offset ?? 3, 0)}`
: " · ATM偏差关"}
{plan?.fixed_direction_enabled
? plan?.fixed_perp_side === "short"
? " · 固定空+Call(实/平)"
: " · 固定多+Put(实/平)"
: plan?.atm_open_offset_enabled
? ` · ATM偏差≤${fmt(plan?.max_atm_open_offset ?? 3, 0)}`
: " · ATM偏差关"}
</span>
</div>
<div className="kv">