Fix OKX abandon residual double-book and fill/residual ledger holes.
After dual-close leaves option pending, continue close_group instead of false residual; reject partial fills on wait timeout; LIVE residual settle allow_negative. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -241,6 +241,24 @@ class StrategyEngine:
|
||||
close_data = r.data
|
||||
if r.ok:
|
||||
self.enter_rest_after_close()
|
||||
elif st == "opening":
|
||||
# 开仓未确认:不自动清槽(可能期权已成交);紧急全平仅告警,防重复开
|
||||
ok = False
|
||||
detail = (
|
||||
"stuck opening:请核对交易所期权/永续后人工处理"
|
||||
"(已占槽防重复开,紧急全平不会自动释放)"
|
||||
)
|
||||
close_data = {"status": "opening"}
|
||||
try:
|
||||
from ..notify import wecom
|
||||
|
||||
wecom.notify_fault(
|
||||
title="紧急全平遇到 stuck opening",
|
||||
detail=detail,
|
||||
dedupe_key="emergency:opening",
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
elif st in ("open", "option_closed_perp_pending"):
|
||||
# A:双腿(或续平永续)
|
||||
r = self.matcher.close_group(reason="emergency", bypass_liquidity=True)
|
||||
|
||||
Reference in New Issue
Block a user