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
View File
@@ -38,6 +38,11 @@ async def sim_open_group(
body: ManualOpenBody | None = None,
) -> dict:
gw = get_gateway()
# 开仓前按现价强制重选 ATM,避免沿用启动时的旧行权价
try:
await gw.ensure_atm_async(force=True)
except Exception as e:
raise HTTPException(status_code=503, detail=f"ATM 对齐失败: {e}") from e
snap = gw.snapshot()
if not snap.pair or not snap.call or not snap.put:
raise HTTPException(status_code=503, detail="行情未就绪")