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:
@@ -272,7 +272,7 @@ class MomentumStrategy(BaseStrategy):
|
||||
"entry_features": {},
|
||||
}
|
||||
|
||||
def check_sell_signals(self) -> List[Dict]:
|
||||
def check_sell_signals(self, only_code: Optional[str] = None) -> List[Dict]:
|
||||
if not self.holdings:
|
||||
return []
|
||||
|
||||
@@ -284,9 +284,15 @@ class MomentumStrategy(BaseStrategy):
|
||||
now,
|
||||
default_hm="15:20",
|
||||
)
|
||||
params_base = dict(self._engine_params or me.get_momentum_defaults_from_db())
|
||||
cached = getattr(self, "_engine_params", None)
|
||||
if cached:
|
||||
params_base = dict(cached)
|
||||
else:
|
||||
params_base = dict(me.get_momentum_defaults_from_db())
|
||||
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user