Color 期期 preview PnL and show RR vs full premium loss.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-19 15:43:01 +08:00
parent 7938628485
commit 38ac258497
6 changed files with 77 additions and 18 deletions
+4
View File
@@ -541,6 +541,10 @@ def build_options_options_preview(
"expiry_flat_total": round(expiry_loss, 4),
"premium_paid": round(prem, 6),
"expiry_is_loss": flat_total <= 0,
# 盈亏比:盈利/全亏保费(风险=权利金全损)
"rr_risk_premium": round(prem, 6),
"rr_at_up": round(at_up / prem, 4) if prem > 0 else None,
"rr_at_down": round(at_dn / prem, 4) if prem > 0 else None,
},
}