修正期期盈亏比口径:按总权利金计算,残值按本合约

盈利腿触发改为盈利金额/总权利金;亏损腿残值20%仍相对该合约自身权利金。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-11 16:51:50 +08:00
parent c5d3d9d6c1
commit a1bf760a28
8 changed files with 58 additions and 35 deletions
+3 -3
View File
@@ -50,7 +50,7 @@ def build_hedge_start_message(plan: dict[str, Any], *, legs: Optional[list[dict[
if rr not in (None, ""):
lines.extend(
[
f"🎯 盈亏比:{_fmt(rr)} (盈利金额/初始权利金)",
f"🎯 盈亏比:{_fmt(rr)} (盈利金额/权利金)",
f"💎 期权保费合计:{_fmt(plan.get('premium_total'), 4)} USDC",
]
)
@@ -176,12 +176,12 @@ def notify_plan_end(cfg: dict[str, Any], conn: Any, plan: dict[str, Any]) -> boo
side = "目标"
mode = (plan.get("oo_close_mode") or "").strip().lower()
if mode in ("close_all", "全平", "残值平"):
rest_txt = "另一腿残值平(权利金≤初始20%且有买一,失败重试)"
rest_txt = "另一腿残值平(本合约权利金≤20%且有买一,失败重试)"
else:
rest_txt = "另一腿到期平(持有至到期结算)"
rr = plan.get("profit_rr")
if rr not in (None, ""):
detail = f"盈亏比 {_fmt(rr)} (盈利金额/初始权利金)"
detail = f"盈亏比 {_fmt(rr)} (盈利金额/权利金)"
else:
detail = (
f"上破 {_fmt(plan.get('target_price_up') or plan.get('target_price'))}"