셀락은 좀 더 고민

롤업만 보강
This commit is contained in:
Your Name
2026-08-14 00:01:20 +09:00
parent 2c7ad867f4
commit 4a18ce2697
5 changed files with 291 additions and 7 deletions

View File

@@ -880,10 +880,22 @@ class OrderManager:
pass
# 손절 등 긴급: 잔량 있으면 즉시 시장가 재매도 (IOC면 pending 이미 seal)
# MAX_URGENT_ESCALATE_COUNT 초과 시 포기 — 모의서버 부분체결 무한루프·락 점유 방지
if remain_after > 0 and is_urgent_market_sell_reason(req.reason or ""):
self._escalate_urgent_sell_market(
req, remain_after, tag="부분체결재매도",
)
_esc = int(getattr(req, "_escalate_count", 0) or 0)
_esc_max = int(get_env_int("MAX_URGENT_ESCALATE_COUNT", 3) or 3)
if _esc < _esc_max:
req._escalate_count = _esc + 1
self._escalate_urgent_sell_market(
req, remain_after, tag="부분체결재매도",
)
else:
logger.warning(
"%s⚠️ [재매도상한] [%s] %s %s — 긴급재매도 %d회 초과"
" (MAX_URGENT_ESCALATE_COUNT=%d), 잔량 %d주 포기%s",
LOG_YELLOW, req.strategy_id, req.name, req.code,
_esc, _esc_max, remain_after, LOG_RESET,
)
return OrderResult(
True, ord_no=ord_no,