feat: 자본 슬롯 시뮬레이터 — 자본 결정을 실시간 시세로 지원 - #435
Merged
Merged
Conversation
대기 중인 자본 결정(#422 A안)의 근거 표가 작성 시점 시세에 고정돼 있어 낡는 문제를 해결한다. 실제로 7/2 기준 34M 권고가 7/6 시세(하이닉스 242.4만→232.2만)로는 32M이 우수(배치율 77.4% vs 74.5%)로 뒤집혔다 — 정수 절사 톱니 효과 때문에 최적 자본은 시세와 함께 움직인다. tools/capital_slot_simulator.py (읽기 전용 — 주문·DB 변경 없음): - simulate_slot_fills(순수): 자본×실효비중 슬롯 → 정수 주수 → 채움율, 미체결(1주 초과·최소거래 미달) 판정. 가격 조회 불가는 별도 표기. - 시세는 실제 사이클과 동일 소스(BasketRebalancer 시세 경로) 재사용. - 기본 스윕(10~62M) 또는 --capital 단일 상세. 현재 10M 상태의 미체결·배치율(58%)을 정확히 재현하는 것으로 검산. 문서 §3 갱신: - 자본 숫자는 결정 시점에 시뮬레이터로 재계산하는 절 + 선택 기준 (미체결 0 · 배치율 -5%p 이내 · 하이닉스 채움 92% 이하 여유를 만족하는 최소 자본) - 재시작일 다중 실행 금지: 6/10 타이밍 비용(-1%p)은 그날 사이클 4회 수동 실행으로 하루 61% 집중 매입한 것이 원인 — 정상 자동화는 회전 상한(15%/일)이 초기 매입을 자연 분할하므로 P2-9(분할 진입)는 코드 불필요로 종결 - 재시작 전제조건(P0-1 머지 + 재시도 크론) 충족 기록 전체 스위트 1604 통과.
easygap
added a commit
that referenced
this pull request
Jul 6, 2026
feat: 자본 슬롯 시뮬레이터 — 자본 결정을 실시간 시세로 지원
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
무엇
대기 중인 유일한 오너 결정(자본, #422 A안)을 돕는 읽기 전용 시뮬레이터와, 재시작 절차의 함정 두 가지를 문서에 반영합니다.
왜
무엇을 했나
tools/capital_slot_simulator.py(신규, 읽기 전용 — 주문·DB 변경 없음)simulate_slot_fills: 자본×실효비중으로 슬롯 금액 → 정수 주수 → 채움율/미체결(1주 초과·최소거래 미달) 판정. 가격 조회 불가는 미체결과 분리 표기(오표기 방지).BasketRebalancer._fetch_current_prices) 재사용.--capital단일 상세.docs/PAPER_MONTH1_REVIEW_AND_PLAN.md§3: "자본 숫자는 결정 시점에 재계산" 절 추가(선택 기준: 미체결 0 + 배치율 -5%p 이내 + 하이닉스 채움 ≤92% 여유를 만족하는 최소 자본), 재시작일 다중 실행 금지 노트, P2-9 종결, 치트시트에 도구 추가, 재시작 전제조건(P0-1+크론) 충족 기록.실측 스모크(7/6 시세):
(도구가 현재 10M 상태의 미체결·배치율을 정확히 재현하는 것으로 검산)
테스트
tests/test_capital_slot_simulator.py— 채움/미체결(1주 초과·최소거래)·가격불명 분리·비중 재정규화·월1 하이닉스 실측 재현 8케이스.pytest tests/전체 통과.