수정본
Some checks failed
CI/CD Pipeline / test-backend (push) Has been cancelled
CI/CD Pipeline / test-frontend (push) Has been cancelled
CI/CD Pipeline / build-and-push (push) Has been cancelled

This commit is contained in:
2026-03-27 14:47:49 +09:00
parent 844ee8944f
commit c818810667
25 changed files with 2708 additions and 266 deletions

View File

@@ -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({