永期手动下单:修币本位杠杆显示,张数定仓与双出场模式.

右侧以张数+比例算永续,杠杆取 env(BTC10/ETH5);开仓买币+5%滑点;出场可选盈利金额(扣双边费)或目标位;平仓后卖光币回 U.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-14 15:43:44 +08:00
parent e474c89c35
commit d68e9c3946
8 changed files with 392 additions and 63 deletions
+5
View File
@@ -340,6 +340,9 @@ def _persist_po(cfg: dict[str, Any], result: dict[str, Any], body: dict[str, Any
"perp_direction": perp_dir,
}
if opt_primary:
exit_mode = str(body.get("exit_mode") or "target").strip().lower()
if exit_mode not in ("profit", "target"):
exit_mode = "target"
plan_row.update(
{
"option_target_points": float(body.get("option_target_points") or 0),
@@ -349,6 +352,8 @@ def _persist_po(cfg: dict[str, Any], result: dict[str, Any], body: dict[str, Any
"strike_interval": float(body.get("strike_interval") or 15),
"min_option_hours": float(body.get("min_option_hours") or 36),
"option_moneyness": str(body.get("moneyness") or body.get("option_moneyness") or ""),
"exit_mode": exit_mode,
"profit_target_usdt": float(body.get("profit_target_usdt") or 0),
}
)
plan_id = insert_plan(conn, plan_row)