Realign ATM to current mark before open; skip while in position.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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="行情未就绪")
|
||||
|
||||
Reference in New Issue
Block a user