期期出场改盈亏比:达目标平盈利腿,亏损腿残值20%或到期平

将上/下破目标价替换为盈亏比(盈利金额/初始权利金,默认2);残值平需买一流动性且权利金≤初始20%。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-11 16:44:45 +08:00
parent e26a67176c
commit c5d3d9d6c1
17 changed files with 566 additions and 198 deletions
+1
View File
@@ -450,6 +450,7 @@ def upsert_hedge_plan_row(
"target_price": _safe_float(plan.get("target_price")),
"target_price_up": _safe_float(plan.get("target_price_up")),
"target_price_down": _safe_float(plan.get("target_price_down")),
"profit_rr": _safe_float(plan.get("profit_rr")),
"legs_json": _legs_json_from_plan(legs),
}
existing = conn.execute(