Add pre-buy expiry breakeven columns to options chain table.
Show estimated expiry balance and distance from index in the chain list and order panel using ask price before opening a position. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -134,6 +134,18 @@ def option_moneyness_label(moneyness: str) -> str:
|
||||
return {"itm": "实值", "otm": "虚值", "atm": "平值"}.get((moneyness or "").lower(), "")
|
||||
|
||||
|
||||
def expiry_breakeven_from_ask(
|
||||
*,
|
||||
opt_type: str,
|
||||
strike: float | None,
|
||||
ask_px: float | None,
|
||||
mark_px: float | None = None,
|
||||
) -> float | None:
|
||||
"""买入前预估到期平衡:权利金按卖一;无卖一时回退标记价。"""
|
||||
prem = ask_px if ask_px is not None and ask_px > 0 else mark_px
|
||||
return expiry_breakeven_px(opt_type=opt_type, strike=strike, avg_px=prem)
|
||||
|
||||
|
||||
def expiry_breakeven_px(
|
||||
*,
|
||||
opt_type: str,
|
||||
|
||||
Reference in New Issue
Block a user