Realign ATM to current mark before open; skip while in position.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-25 07:52:37 +08:00
parent 1155cf082d
commit 7db4c9c8a3
4 changed files with 70 additions and 6 deletions
+5 -1
View File
@@ -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