feat(sim): 관찰목록 자동편입/제외 — 키움 순위정보로 주도주 매일 편입

- kiwoom_client: get_volume_surge(ka10023)·get_foreign_inst_netbuy(ka90009) 순위 조회 추가 (rkinfo endpoint)
- universe: auto_import(외인·기관 순매수+거래량급증 상위, ETF·하락·급증률이상치 제외, 각15·총120 상한, origin=auto) + auto_prune(auto·미보유·10거래일 무신호만, 보유/수동/비하이브 불가침) + mark_signals
- engine.scan_all: 변이 watching 종목을 mark_signals로 신호 추적(auto_seen.json)
- CLI: python3 -m sim universe {import|prune|all}
- trade-journal plist 평일21:00에 'sim universe all' 4번째 명령 추가
- 첫 실행: 후보38 → 32편입 (59→91종목)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
hyowons
2026-06-15 19:03:35 +09:00
parent e3c54d62ed
commit a5e52dc69b
7 changed files with 329 additions and 3 deletions
+10
View File
@@ -472,6 +472,16 @@ def scan_all(force: bool = False) -> dict:
'held': sorted(vpf.positions)})
compare.sort(key=lambda c: c['summary'].get('total_return_pct', 0) or 0, reverse=True)
# 자동편입(auto) 종목 신호 추적 — 한 변이라도 노리는(매수/대기) 종목은 '살아있음' 기록 (auto_prune 판단용)
try:
from . import universe as _um
sig = {it['code'] for c in compare for it in (c.get('watching') or []) if it.get('code')}
if sig:
_um.mark_signals(sorted(sig))
except Exception:
pass
variants_mod.COMPARE_PATH.write_text(json.dumps({
'scanned_at': now.isoformat(), 'session': is_market_session(now),
'variants': compare,