feat(execution): AccountOrderWorker로 매수·매도 주문 직렬화

전략별 tick/scan 매도 락 대신 계좌 단일 PriorityQueue로 place를 B-full 직렬화한다.
틱매도 only_code 필터와 inflight 중복 enqueue 방지로 REST 폭주를 줄인다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Your Name
2026-08-28 16:45:26 +09:00
parent ffe84a9375
commit bc2b1b642c
15 changed files with 541 additions and 207 deletions

View File

@@ -331,7 +331,7 @@ class ScalpingStrategy(BaseStrategy):
# ------------------------------------------------------------------
# 매도
# ------------------------------------------------------------------
def check_sell_signals(self) -> List[Dict]:
def check_sell_signals(self, only_code: Optional[str] = None) -> List[Dict]:
"""엔진 check_sell_signal_live 사용 (백테스트 동일)."""
if not self.holdings:
return []
@@ -348,7 +348,11 @@ class ScalpingStrategy(BaseStrategy):
)
try:
params = se.get_scalping_defaults_from_db()
cached = getattr(self, "_scan_engine_params", None) or {}
if cached:
params = dict(cached)
else:
params = se.get_scalping_defaults_from_db()
except Exception:
params = {}
params.update({
@@ -370,6 +374,8 @@ class ScalpingStrategy(BaseStrategy):
})
for code, holding in list(self.holdings.items()):
if only_code and code != only_code:
continue
try:
name = holding.get("name", code)
buy_price = float(holding.get("buy_price", 0))