Files
QuantEngineByItz/spec/strategy/sector_model.yaml
T
kjh2064 ee3e799de1 feat: 리밸런싱 엔진 V1 + GAS 버그 수정 (2026-06-13)
주요 변경:
- tools/build_rebalance_engine_v1.py: REBALANCE_ENGINE_V1 신규
  * account_snapshot 직접 합산(_build_snap_position_map) → 소수주 분리 행 병합
  * 레짐 소스 macro.REGIME_PRELIM 최우선 (GAS 와 동일)
- src/gas_adapter_parts/gdf_06_rebalance.gs: runRebalanceSheet_() 신규
  * Logger.log / getSpreadsheet_() 로 run_all 연동 수정
- src/gas_adapter_parts/gdc_01_fetch_fundamentals.gs
  * _mergePositionRecord_(): 소수주 중복 행 합산 신규
  * parseInt → parseFloat (qty, availQty)
- src/gas_adapter_parts/gdf_01_price_metrics.gs
  * 미보유 종목 SELL_READY → WATCH_EXIT_SIGNAL
- spec/41_release_dag.yaml: build_rebalance_sheet 노드 추가 (step_count 63)
- spec/51_formula_lifecycle_registry.yaml: REBALANCE_ENGINE_V1 등록

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 13:20:14 +09:00

69 lines
5.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
meta:
title: "은퇴자산포트폴리오 — 섹터 모델 분할 후보"
parent_file: "spec/04_strategy_rules.yaml"
version: "2026-05-15-F8_split"
language: "ko-KR"
timezone: "Asia/Seoul"
role: "canonical"
migration_status: "canonical_split_active"
authority_rule: "이 split 파일이 해당 섹션의 canonical source다. parent_file은 legacy compatibility index다."
sector_model:
score_axes: ["1M/3M 상대강도", "거래대금", "외국인·기관 수급", "실적전망", "거시환경", "밸류에이션"]
score_axes_formula: # [P128] 100점 만점 채점 공식 — A_core/B_wait/C_watch/D_exclude 임계치 근거
total: 100
components:
price_strength: {axis: "1M/3M 상대강도", weight: 25, score_rule: "섹터 내 1M 상대강도 상위 30% 이내→25점; 30~60%→15점; 60% 초과→0점"}
volume_quality: {axis: "거래대금", weight: 15, score_rule: "5D 거래대금 20D 평균 대비 120% 이상→15점; 80~120%→8점; 미만→0점. ETF proxy는 etf_raw.ETF_Liquidity_Score를 별도 반영"}
flow_quality: {axis: "외국인·기관 수급", weight: 25, score_rule: "sector_flow 기준 Sector_Flow_Quality = 0.6×SmartMoney_5D_Norm_Score + 0.4×Flow_Breadth_5D_Score. legacy sector_flow 단독으로 A_core 근거 금지"}
earnings_revision: {axis: "실적전망", weight: 20, score_rule: "컨센서스 EPS 상향→20점; 유지→10점; 하향→0점"}
macro_regime: {axis: "거시환경", weight: 10, score_rule: "Risk-On(VIX<18, KOSPI>MA20)→10점; Neutral→5점; Risk-Off→0점"}
valuation: {axis: "밸류에이션", weight: 5, score_rule: "PER/PBR 섹터 평균 이하→5점; 평균~1.5배→2점; 1.5배 초과→0점"}
flow_credit_definition_xref: "quant_feed_contract.investor_flow_rules.active_quality_gate.formula # 종목 단위 flow_credit 정의 위치. 섹터 단위는 sector_flow 원화 수급·확산도 우선."
prohibition: "점수 미산출 시 A_core 판정 금지. 데이터 누락 축은 0점 처리 후 DATA_MISSING 표시. sector_flow.Data_Quality가 C 또는 D이면 Strong_Buy 및 섹터 단독 Strong_Sell 금지. sector_universe.Is_ETF=Y 행은 구성종목 수급 집계에서 제외한다."
grade:
alias_of: "recommendation_grade" # [ALIAS / proposal_118] A_core=A, B_wait=B, C_watch=C, D_exclude=D. 기준은 recommendation_grade 참조.
A_core: "80점 이상 (원시데이터 80% 이상 확인, 비용차감 기대수익비 2:1 이상, 돌파 직후가 아니라 확인 후 진입)"
B_wait: "65~79점 또는 가격 과열, 신고가 직후·장대양봉 직후는 대기"
C_watch: "50~64점 또는 데이터 일부 누락"
D_exclude: "50점 미만 또는 핵심 데이터 충돌"
missing_data_rule: ["가격·수급·거래대금 중 2개 이상 누락 시 최대 C-관찰", "프록시만으로 A등급 금지", "점수 개선 당일 추격매수 금지", "신고가/돌파 당일은 시범진입만 허용하고 본진입은 다음 거래일 확인 후"]
core_satellite_classification_score:
purpose: >
종목의 처우(trailing band·time-stop·risk_budget)를 결정하기 위한
단일 분류 기준. 진입 판단과 무관하며 진입 이후 처우 기준 통일 목적.
formula: "CSCS = W1×kospi_weight_factor(0.30) + W2×flow_strength_20d(0.30) + W3×holding_stability(0.20) + W4×atr_stability(0.20)"
weights:
W1_kospi_weight_factor:
weight: 0.30
scoring: "KOSPI 시총 비중 >=1%:100pt / 0.5~1%:70pt / 0.1~0.5%:40pt / <0.1%:10pt. KOSDAQ종목:0pt."
W2_flow_strength_20d:
weight: 0.30
scoring: "Frg_20D+Inst_20D 합산 양수&Flow_Rows>=20:100pt / 어느 하나만 양수:60pt / 둘 다 음수:0pt. Flow_OK=N:0pt."
W3_holding_stability:
weight: 0.20
scoring: "보유 >=60거래일:100pt / 30~59:70pt / 10~29:40pt / <10거래일:0pt. 보유기간 미확인:50pt(중립)."
W4_atr_stability:
weight: 0.20
scoring: "ATR20_Pct <3%:100pt / 3~5%:70pt / 5~8%:40pt / >=8%:10pt. ATR20 DATA_MISSING:50pt(중립)."
classification:
core: "CSCS >= 70 → 코어 처우"
satellite: "CSCS < 70 → 위성 처우"
treatment_mapping:
core_treatment:
trailing_bands: "take_profit.trailing_stop.core_large_cap"
time_stop: "stop_loss.time_stop.core"
risk_budget_cap: "단일 종목 총자산 1.0~1.2% 이내"
satellite_treatment:
trailing_bands: "take_profit.trailing_stop.satellite_trigger"
time_stop: "stop_loss.time_stop.satellite"
risk_budget_cap: "단일 종목 총자산 0.7~1.0% 이내"
special_exception:
- "삼성전자(005930)·SK하이닉스(000660): CSCS 계산 없이 항상 core 처우. special_exception.kospi_semiconductor_leadership 우선."
hard_rules:
- "CSCS 미산출 종목: 보유비중으로 수동 판단. 코어/위성 자동 구분 금지."
- "W2·W4가 DATA_MISSING이면 해당 항목 50pt 중립 처리."
- "CSCS는 진입 결정이 아닌 진입 후 처우 결정에만 사용."
output_required:
columns: ["종목명", "CSCS점수", "W1", "W2", "W3", "W4", "분류(코어/위성)", "적용_trailing", "time_stop_기준일"]