Realign ATM to current mark before open; skip while in position.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -412,7 +412,11 @@ class Matcher:
|
||||
perp_upl = (perp_entry - float(mark)) * perp_qty
|
||||
|
||||
option_side = str(pos["option_side"])
|
||||
oq = snap.call if option_side == "call" else snap.put
|
||||
# 优先用持仓合约盘口,避免 ATM 切换后盯错合约
|
||||
opt_inst = str(pos.get("option_inst_id") or "")
|
||||
oq = gw.cache.get(opt_inst) if opt_inst else None
|
||||
if oq is None:
|
||||
oq = snap.call if option_side == "call" else snap.put
|
||||
opt_mark = None
|
||||
if oq:
|
||||
opt_mark = oq.bid or oq.mark_px
|
||||
|
||||
Reference in New Issue
Block a user