Files
QuantEngineByItz/spec/strategy/macro_event_synchronizer_v2.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

41 lines
1.9 KiB
YAML

schema_version: macro_event_synchronizer.v2
formula_id: MACRO_EVENT_SYNCHRONIZER_V2
purpose: >
macro/event rows are CONTEXT_ONLY inputs and must not be used to create prices.
P1-013: macro_risk_score -> position_size_scale + cash_target_pct 자동 조정.
python_tool: tools/build_macro_event_synchronizer_v2.py
required_metrics:
- macro_event_rows_freshness_hours # <= 24
- event_hold_gate_coverage # == 100%
- position_size_scale_wired # == 100 (JSON 제공됨)
- external_context_used_for_price_count # == 0
- position_size_scale # NEW: macro_risk_score에서 산출
- cash_target_pct # NEW: macro_risk_score에서 산출
# -- position_size_scale 산출 공식 (P1-013 신규) --
position_size_scale_formula:
input: macro_risk_score # hApex.macro_risk_score (0~100)
table:
NORMAL: {threshold: "<20", scale: 1.00, cash_target_pct: 5.0}
CAUTION: {threshold: "20-40", scale: 0.75, cash_target_pct: 15.0}
HIGH_RISK: {threshold: "40-60", scale: 0.50, cash_target_pct: 25.0}
VERY_HIGH: {threshold: "60-80", scale: 0.25, cash_target_pct: 40.0}
EXTREME: {threshold: ">=80", scale: 0.00, cash_target_pct: 60.0}
note: >
scale은 주문 수량 상한 계수. scale=0.5이면 기준 수량의 50% 이하만 집행.
EXTREME(scale=0.00)이면 신규 매수 금지.
# -- event_hold_gate --
event_hold_gate:
pre_guard_days: 5 # HIGH Impact 이벤트 5일 전부터 신규 BUY 차단
post_guard_days: 2 # 이벤트 후 2일 포지션 축소 구간
applies_to: HIGH,VERY_HIGH # MEDIUM 이벤트는 WATCH만
# -- 금지 사항 --
prohibitions:
- "macro/event 외부 데이터를 주문 가격 산출에 직접 사용 금지"
- "event_hold 종목 guard 구간 내 신규 BUY 금지"
- "position_size_scale=0.00(EXTREME)에서 신규 진입 금지"
- "macro_risk_score 변경 없이 position_size_scale 임의 수정 금지"