수정본
This commit is contained in:
@@ -277,11 +277,15 @@ class MDDManager:
|
||||
await enqueue_close_active_trade(stock_code)
|
||||
else:
|
||||
# 부분 매도: remaining_pct 갱신
|
||||
# 기존 ActiveTrade의 remaining_pct에 매도 비율을 곱해야 함
|
||||
# (예: 기존 0.5 * 남은비율 0.7 = 0.35)
|
||||
# db_worker가 직접 setattr하므로, reduce_ratio를 전달하여
|
||||
# 워커가 기존 값에 곱하도록 처리
|
||||
from app.services.db_worker import enqueue_active_trade_upsert
|
||||
new_remaining = remaining_qty / quantity
|
||||
sell_ratio = remaining_qty / quantity # 남은 비율 (0.7 or 0.5)
|
||||
await enqueue_active_trade_upsert({
|
||||
"stock_code": stock_code,
|
||||
"remaining_pct": new_remaining,
|
||||
"remaining_pct_multiply": sell_ratio,
|
||||
})
|
||||
|
||||
results.append({
|
||||
|
||||
Reference in New Issue
Block a user