feat(options): use premium profit RR instead of target index

单独期权与中控改为盈亏比×权利金触发买一平仓,默认2;不达标等到期。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-11 10:34:14 +08:00
parent 3b56e15fb1
commit 5c3969674a
13 changed files with 494 additions and 194 deletions
+3
View File
@@ -72,11 +72,14 @@ def fetch_light_option_positions_for_dashboard(cfg: dict[str, Any]) -> list[dict
mon = tgt_map.get(str(row.get("inst_id") or ""))
if mon:
row["target_index"] = mon.get("target_index")
row["profit_rr"] = mon.get("profit_rr")
row["target_monitor_id"] = mon.get("id")
row["target_monitor"] = mon
hedge_target = hedge_target_map.get(str(row.get("inst_id") or ""))
if hedge_target:
row["hedge_plan_target"] = hedge_target
if hedge_target.get("oo_profit_rr") is not None and row.get("profit_rr") is None:
row["profit_rr"] = hedge_target.get("oo_profit_rr")
if not mon:
row["target_index"] = hedge_target.get("target_index")
rows.append(row)