Files
QuantEngineByItz/spec/formulas/domains/entry.yaml
T
kjh2064 782fe74578 feat(quant-engine): 10개 고전 기술전략 갭분석 후 7개 보조신호 채택
사용자 제시 10개 고전 기술전략(골든크로스/모멘텀/52주신고가/연속상승하락/이격도/돌파실패/
강한종가/변동성확장/평균회귀/추세필터)을 기존 엔진과 대조한 갭분석 결과:
- 이미 구현됨: 모멘텀(VELOCITY_V1/RS_MOMENTUM_V1), 이격도·평균회귀(MEAN_REVERSION_GATE_V1)
- 신규 채택 7개: GOLDEN_CROSS_SIGNAL_V1, STRONG_CLOSE_SIGNAL_V1,
  VOLATILITY_EXPANSION_BREAKOUT_V1, FIFTY_TWO_WEEK_HIGH_TRIGGER_V1, CONSECUTIVE_STREAK_V1,
  BREAKOUT_FAILURE_STOP_V1, TREND_FILTER_GATE_V1

AGENTS.md 하드룰(추격매수 방지, anti-late-entry gate 필수통과)에 따라 BUY 방향 신호 전부를
STRATEGY_SCORING의 보조신호로만 편입 — BREAKOUT_QUALITY_GATE_V2/FOLLOW_THROUGH_DAY_CONFIRM_V1/
ANTI_LATE_ENTRY_GATE_V2 게이트 체인을 우회하는 독립 BUY 트리거로는 사용하지 않음.

검증: validate_specs/validate_golden_coverage_100(100%)/validate_calibration_registry_v1/
validate_schema_model_generation_v1/validate_agents_shrink_v1 전부 PASS. golden test 22/22 PASS.

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

1075 lines
40 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.
schema_version: formula_domain.v1
source: C:\Temp\data_feed\spec\13_formula_registry.yaml
domain: entry
formulas:
SEA_TIMING_V1:
purpose: 장중 VWAP 및 거래량 프로파일을 이용한 최적의 엑싯(Exit) 타이밍 포착
inputs:
- field: current_price
unit: KRW_per_share
- field: vwap
unit: KRW_per_share
optional: true
note: 장중 거래량 가중 평균가
- field: rsi_15m
unit: points
optional: true
note: 15분봉 RSI
- field: volume_climax
unit: boolean
optional: true
note: 단기 거래량 폭증 여부
rules:
- if: current_price < vwap AND volume_climax == true
action: EXIT_NOW
label: 반등_종료_확인
- if: rsi_15m < 30 AND current_price < vwap
action: EXIT_DELAY_FOR_REBOUND
label: 지하실_매도_방지
output:
field: sea_action_tag
unit: string
owner: quant_team
lifecycle_state: active
input_fields:
- current_price
- vwap
- rsi_15m
- volume_climax
output_fields:
- sea_action_tag
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
BREAKOUT_QUALITY_GATE_V2:
purpose: '신고가 돌파 이후 3일 이상 달린 종목, MA20 대비 10% 이상 괴리, 갭업+거래량 미동반, RSI 과매수, 이미 매도신호
발생 조합을 정량 점수로 차단. N2(VOLUME_BREAKOUT_CONFIRM_V1)보다 넓은 뒷박 방지 범위를 커버한다. BUY 게이트
체인 Gate 4에서 BREAKOUT_QUALITY_GATE_V2 != BLOCKED_LATE_CHASE 조건으로 사용.
'
applicable: 매수 후보 종목 분석 시 항상 실행. 신규 BUY 전 Gate 4 필수 통과.
inputs:
- field: close
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
- field: ret_3d
unit: percent
note: 3거래일 수익률 (%)
- field: ret_1d
unit: percent
note: 전일 대비 수익률 (%)
- field: disparity
unit: percent
note: (close/MA20 - 1) × 100
- field: rsi14
unit: points
optional: true
- field: volume
unit: shares
optional: true
- field: avg_volume_5d
unit: shares
optional: true
- field: timing_score_exit
unit: points_0_100
optional: true
- field: distribution_risk_score
unit: points_0_100
optional: true
- field: late_chase_risk_score
unit: points_0_100
optional: true
scoring:
penalties:
- condition: ret_3d >= 7
score: -30
label: 3일_7%이상_달림
- condition: disparity > 10
score: -25
label: MA20_10%이상_괴리
- condition: ret_1d >= 4 AND volume < avg_volume_5d * 0.9
score: -40
label: 갭업+거래량_미동반
- condition: rsi14 > 75
score: -20
label: RSI_과매수
- condition: timing_score_exit >= 50
score: -50
label: 매도신호_이미_발생
- condition: distribution_risk_score >= 70
score: -35
label: 분배위험_고
- condition: late_chase_risk_score >= 70
score: -30
label: 뒷박위험_고
bonuses:
- condition: volume >= avg_vol_5d * 1.5 AND ret_1d >= 2 AND ret_3d < 5
score: 25
label: 거래량_동반_초기돌파
- condition: disparity >= 0 AND disparity < 6
score: 15
label: MA20_적정_괴리
- condition: rsi14 >= 45 AND rsi14 <= 65
score: 10
label: RSI_적정_구간
base_score: 50
states:
BLOCKED_LATE_CHASE: base_score + penalties + bonuses < 10 → 뒷박 완전 차단
WATCH_COOLING_OFF: 10 <= total_score < 40 → 과열 식힘 대기
PILOT_ALLOWED: total_score >= 40 → 파일럿 진입 허용 (다른 게이트 통과
필요)
output:
field: breakout_quality_gate
unit: enum [BLOCKED_LATE_CHASE, WATCH_COOLING_OFF, PILOT_ALLOWED]
additional_fields:
- breakout_quality_score
- breakout_quality_reasons
missing_policy:
ret_3d: DATA_MISSING — WATCH_COOLING_OFF으로 보수 처리
ma20: DATA_MISSING — BLOCKED_LATE_CHASE 처리
all_optional_missing: 기본 점수(50)에서 페널티 없이 PILOT_ALLOWED 가능하나 DATA_MISSING 태그
필수
prohibition:
- BLOCKED_LATE_CHASE 상태에서 LLM이 '좋아 보이니까 매수' 서술 절대 금지
- base_score를 LLM이 재계산하거나 패널티를 임의 무시 금지
- disparity·ret_3d 데이터 없이 PILOT_ALLOWED 판정 금지
harness_lock: true
llm_override: forbidden
canonical_ref: AGENTS.md:Direction N2 (VOLUME_BREAKOUT_CONFIRM_V1) 확장
version: 2026-05-20_HARNESS_V5
owner: quant_team
lifecycle_state: active
input_fields:
- close
- ma20
- ret_3d
- ret_1d
- disparity
- rsi14
- volume
- avg_volume_5d
- timing_score_exit
- distribution_risk_score
- late_chase_risk_score
output_fields:
- breakout_quality_gate
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
FOLLOW_THROUGH_DAY_CONFIRM_V1:
purpose: 'O''Neil Follow-Through Day 개념을 정량화한다. 돌파 첫날(Day 1)에는 WATCH_FOLLOW_THROUGH_PENDING,
확인일(Day 2~7 이내 +1.5% 이상 상승 + 거래량 직전 돌파일 대비 90% 이상)에만 BUY_PILOT_ALLOWED. 7일 이후에도
미확인이면 FOLLOW_THROUGH_FAIL로 리셋. 첫날 돌파 즉시 BUY 지시를 구조적으로 차단해 설거지 손실을 방지한다.
'
applicable: 신규 BUY 후보 분석 시 항상 실행. Gate 4b로 BREAKOUT_QUALITY_GATE_V2 이후 적용.
inputs:
- field: days_since_breakout
unit: trading_days
note: 0 = 돌파 당일. GAS 추적값 또는 data_feed 컬럼.
- field: ret_since_breakout
unit: pct
note: 돌파일 종가 대비 현재 수익률
- field: vol_today
unit: shares
note: 당일 거래량
- field: vol_breakout_day
unit: shares
note: 돌파일 거래량 (backdata에서 참조)
- field: close
unit: KRW_per_share
optional: true
- field: ma20
unit: KRW_per_share
optional: true
states:
BREAKOUT_DAY_1:
condition: days_since_breakout == 0
result: WATCH_FOLLOW_THROUGH_PENDING
note: 돌파 당일 BUY 절대 금지. 다음 거래일 재확인 대기.
FOLLOW_THROUGH_OK:
condition: days_since_breakout >= 2 AND days_since_breakout <= 7 AND ret_since_breakout
>= 1.5 AND vol_today >= vol_breakout_day * 0.9
result: BUY_PILOT_ALLOWED
note: 확인일 조건 충족 — 파일럿 진입 허용.
FOLLOW_THROUGH_FAIL:
condition: days_since_breakout > 7 OR (days_since_breakout >= 2 AND ret_since_breakout
< 0)
result: WATCH_RESET_REQUIRED
note: FTD 실패 또는 7일 초과. 추격 금지, 재설정 대기.
EXTENDED_FOLLOW:
condition: days_since_breakout > 7 AND ret_since_breakout >= 0
result: WATCH_TOO_LATE
note: 7일 이후 상승 유지 중이지만 확인일 놓침. 뒷박 위험.
PENDING_DATA:
condition: days_since_breakout IS NULL
result: WATCH_NO_BREAKOUT_TRACKED
note: 돌파 추적 데이터 없음. DATA_MISSING 태그 필수.
output:
fields:
follow_through_day_state: WATCH_FOLLOW_THROUGH_PENDING / BUY_PILOT_ALLOWED
/ WATCH_RESET_REQUIRED / WATCH_TOO_LATE / WATCH_NO_BREAKOUT_TRACKED
days_since_breakout: 추적된 돌파 경과 거래일 수
ret_since_breakout: 돌파일 종가 대비 현재 수익률 %
vol_ratio_vs_breakout_day: vol_today / vol_breakout_day 비율
missing_policy:
days_since_breakout: null → WATCH_NO_BREAKOUT_TRACKED. BUY 진행 가능하나 DATA_MISSING
표기.
vol_breakout_day: null → vol 조건 충족 여부 판정 불가. DATA_MISSING, 타 조건만으로 판정.
prohibition:
- days_since_breakout=0(돌파 당일) 종목을 LLM이 즉시 BUY_PILOT_ALLOWED로 판정 금지
- FOLLOW_THROUGH_FAIL 상태를 '좋은 종목이니 예외 허용' 서술로 우회 금지
- days_since_breakout·ret_since_breakout을 LLM이 임의 계산 금지 (GAS 하네스값 인용)
harness_lock: true
llm_override: forbidden
canonical_ref: engine_harness_upgrade_proposal_result.txt:2-B
version: 2026-05-20_HARNESS_V5
owner: quant_team
lifecycle_state: active
input_fields:
- days_since_breakout
- ret_since_breakout
- vol_today
- vol_breakout_day
- close
- ma20
output_fields: []
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
EXECUTION_QUALITY_SCORE_V1:
purpose: '실제 주문 실행 후 T+1/T+3/T+5 결과를 정량 채점해 엔진 임계치 자동 개선 루프를 만든다. POOR 등급 누적 시
Late Chase 임계치 강화, Entry 임계치 완화 등을 자동 제안한다. 채점 결과는 proposal_evaluation_history.json에
누적 저장된다.
'
applicable: daily-feedback-report 실행 시. T+1 결과 확정 후 자동 업데이트.
inputs: []
scoring:
buy_entry_quality:
description: 매수 진입 타이밍 채점 (최대 +20, 최소 -35)
components:
- condition: next_1d_ret >= 0
score: +1 per 0.5% (최대 +10)
- condition: next_3d_max_favorable
score: +1 per 1% (최대 +10)
- condition: would_trigger_stop_t1=true
score: -20
note: T+1 손절 발생
- condition: breakout_confirmed=true
score: 5
- condition: late_chase_confirmed=true
score: -15
sell_exit_quality:
description: 매도 타이밍 채점 (최대 +25, 최소 -20)
components:
- condition: sold_above_ma20=true
score: 10
- condition: rebound_after_sell_3d > 0
score: -(rebound_pct × 2)
note: 팔고 오른 경우 감점
- condition: sold_near_support=true
score: -10
- condition: cash_recovered_target=true
score: 15
cash_raise_quality:
description: 현금확보 경로 채점
components:
- condition: cash_target_achieved=true
score: 10
- condition: core_position_preserved=true
score: 5
- condition: route_used=ROUTE_A
score: 5
- condition: route_used=ROUTE_B
score: 3
- condition: route_used=ROUTE_C
score: 0
- condition: route_used=ROUTE_D
score: -5
grades:
EXCELLENT: total_score >= 15
GOOD: 5 <= total_score < 15
NEUTRAL: -5 <= total_score < 5
POOR: total_score < -5
outcome_classification:
FALSE_BUY_TIMING: BUY_PILOT_ALLOWED 후 T+1 손절 → Late Chase 임계치 강화 제안
MISSED_ENTRY: WATCH_ONLY 후 +3% 이상 → Entry 임계치 완화 제안
TRUE_NEGATIVE: BUY_BLOCKED_T1 후 하락 → 공식 유효성 확인
PORTFOLIO_GUARD_EFFECTIVE: SELL_OR_TRIM 후 현금 회복 → 규칙 유지
output:
fields:
execution_quality_score: 총 채점 점수
execution_quality_grade: EXCELLENT / GOOD / NEUTRAL / POOR
execution_quality_outcome: 결과 분류 enum
threshold_adjustment_proposals: POOR 시 임계치 조정 제안 목록
storage:
file: Temp/proposal_evaluation_history.json
auto_run: npm run daily-feedback-report
prohibition:
- execution_quality_grade를 LLM이 임의 산정 금지
- threshold_adjustment_proposals를 LLM이 즉각 반영 금지 — 제안만 출력
- 채점 데이터 없이 '실행 품질 양호'로 단정 금지
harness_lock: true
llm_override: forbidden
canonical_ref: engine_harness_upgrade_proposal_result.txt:2-E
version: 2026-05-20_HARNESS_V5
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
REPLACEMENT_ALPHA_GATE_V1:
purpose: '위성 신규매수 전 코어 대비 알파 우위 여부를 기계적으로 검증한다. 코어보다 약한 위성에 현금을 투입하는 ''설거지 추가매수''를
원천 차단. CLA 레짐 또는 CLUSTER_HOLD_ONLY 상태에서 RAG_V1 FAIL이면 allowed_action = HOLD
강제.
'
applicable: 위성 신규 BUY 주문 생성 전 calcFinalDecision_ 내에서 실행.
inputs:
- field: rs_verdict
unit: enum
note: RS_VERDICT_V1 결과
- field: ss001_grade
unit: enum [A,B,C,D]
- field: excess_ret_10d
unit: pct
note: KOSPI 대비 초과 10D 수익률
- field: portfolioStats.coreAvgSS001
unit: points_0_100
optional: true
note: 코어 종목 평균 SS001 정규화 점수
conditions_all_required_for_PASS:
condA: rs_verdict IN [LEADER, MARKET]
condB: 'ss001_norm_score >= (coreAvgSS001 - 10) # coreAvgSS001 미확인 시 60 적용'
condC: excess_ret_10d >= -5
condD: excess_ret_10d >= 0 OR rs_verdict == LEADER
output:
field: rag_v1
unit: enum [PASS, FAIL, EXEMPT]
additional_fields:
- rag_reason
rag_reason_codes:
rs_verdict_weak: condA 실패 — rs_verdict가 LAGGARD 또는 BROKEN
ss001_below_core: condB 실패 — SS001이 코어 평균보다 10점 이상 낮음
excess_ret_breach: condC 실패 — 10일 초과수익률 -5% 이하
rs_slope_negative: condD 실패 — 초과수익률 음수이고 LEADER도 아님
core_exempt: 코어 종목 — RAG 미적용
pass: 모든 조건 충족
gate_action:
FAIL: allowed_action을 BUY에서 HOLD로 강제 전환
PASS: 정상 진행
EXEMPT: 코어 종목 — 판정 없이 통과
ground_truth: harness
llm_allowed: cite_only
prohibition:
- rag_v1 = FAIL인 종목에 LLM이 '이번만 예외'로 BUY 허용 금지
- portfolioStats.coreAvgSS001 미확인 상태에서 condB를 LLM이 임의 계산 금지
canonical_ref: spec/11_market_regime.yaml:CONCENTRATED_LEADER_ADVANCE
version: 2026-05-21_CLA_HARNESS_V1
owner: quant_team
lifecycle_state: active
input_fields:
- rs_verdict
- ss001_grade
- excess_ret_10d
- portfolioStats.coreAvgSS001
output_fields:
- rag_v1
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SATELLITE_ALPHA_QUALITY_GATE_V1:
purpose: 위성 후보가 BUY 후보로 노출되기 전 5개 필터로 ELIGIBLE/WATCHLIST_ONLY/EXCLUDED를 확정한다.
inputs:
- field: position_class
unit: enum [core,satellite]
- field: ss001_grade
unit: enum [A,B,C,D]
- field: price.ret20D
unit: pct
- field: globalKospiRet20D_
unit: pct
- field: recovery_ratio_20d
unit: ratio
- field: recovery_ratio_5d
unit: ratio
- field: excess_drawdown_pctp
unit: pct_points
- field: frg_5d_sh
unit: shares
- field: inst_5d_sh
unit: shares
- field: rs_verdict
unit: enum
filters:
F1_relative_return: price.ret20D > globalKospiRet20D_
F2_recovery_power: recovery_ratio_20d >= 1.20 OR recovery_ratio_5d >= 1.30
F3_downside_protection: excess_drawdown_pctp <= 5
F4_institutional_flow: frg_5d_sh > 0 OR inst_5d_sh > 0
F5_sector_leadership: rs_verdict IN [LEADER, MARKET]
classification:
ELIGIBLE: total_penalty == 0
WATCHLIST_ONLY: total_penalty IN [1,2] AND F1/F2/F3 중 하나만 실패
EXCLUDED: total_penalty >= 3 OR F1/F2/F3 중 2개 이상 실패 OR ss001_grade=D OR rs_verdict=BROKEN
gate_action:
ELIGIBLE: BUY 후보 표기 가능. RAG_V1 추가 통과 필요.
WATCHLIST_ONLY: WATCH만 허용. BUY/파일럿 서술 금지.
EXCLUDED: BUY 후보 및 주문표에서 제거. 보유 종목이면 정리 검토 입력.
output:
field: saqg_v1
additional_fields:
- saqg_penalty
- saqg_failed_filters
ground_truth: harness
llm_allowed: cite_only
version: 2026-05-21_SAQG_V1
owner: quant_team
lifecycle_state: active
input_fields:
- position_class
- ss001_grade
- price.ret20D
- globalKospiRet20D_
- recovery_ratio_20d
- recovery_ratio_5d
- excess_drawdown_pctp
- frg_5d_sh
- inst_5d_sh
- rs_verdict
output_fields:
- saqg_v1
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ALPHA_EVALUATION_WINDOW_V1:
purpose: 위성 추천 성과를 T+20/T+60에서 삼성전자·SK하이닉스 대비 초과수익으로 평가한다. T+1 단독 평가는 금지한다.
inputs:
- field: entry_date
unit: date
- field: position_class
unit: enum [core,satellite]
- field: t20_return_pct
unit: pct
optional: true
- field: t60_return_pct
unit: pct
optional: true
- field: benchmark_core_return_pct
unit: pct
optional: true
gates:
T20_ALPHA_FAIL: t20_vs_core_pctp < -3
T60_ALPHA_FAIL: t60_vs_core_pctp < -5
PASS: benchmark excess return >= 0
missing_policy: 성과 창 미도래 또는 데이터 누락 시 DATA_MISSING — LLM 대체 산출 금지.
output:
field: alpha_evaluation_window_json
ground_truth: harness
llm_allowed: cite_only
version: 2026-05-21_AEW_V1
owner: quant_team
lifecycle_state: active
input_fields:
- entry_date
- position_class
- t20_return_pct
- t60_return_pct
- benchmark_core_return_pct
output_fields:
- alpha_evaluation_window_json
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ALPHA_FEEDBACK_LOOP_V1:
purpose: 'monthly_history의 AEW_V1 성과 데이터를 분석해 SAQG_V1 필터 임계값 조정 권고를 생성한다. 임계값
자동 변경 금지. 하네스는 권고만 생성하고 사용자가 settings 파일에서 확인 승인.
'
applicable: 월 1회 settings 업데이트 배치 시 실행.
inputs:
- field: alpha_evaluation_window_json
unit: array
- field: saqg_v1
unit: enum
- field: brt_verdict
unit: enum
- field: market_regime
unit: string
analysis:
eligible_t20_fail_rate: ELIGIBLE 케이스 중 t20_vs_samsung_pctp < -3 비율
by_filter_combination: F1+F2+F3 통과 조합별 T+20 실패율 분포
feedback_recommendation:
threshold_tighten:
condition: ELIGIBLE T+20 알파 실패율 > 50%
recommendation: 'SAQG F1/F2/F3 임계값 강화 권고 (예: F2 recovery_ratio 1.20 -> 1.35)'
threshold_relax:
condition: ELIGIBLE T+20 성공률 > 70% AND 최근 12건 이상
recommendation: 'SAQG F3 임계값 완화 검토 (예: excess_drawdown 5%p -> 7%p)'
output_fields:
- field: alpha_feedback_json
subfields:
- eligible_t20_fail_rate
- eligible_t60_fail_rate
- recommended_filter_adjustments
- cases_analyzed
hard_rules:
- 임계값 자동 변경 금지 - 권고(RECOMMENDATION) 출력만
- cases_analyzed < 10이면 DATA_INSUFFICIENT - 권고 생성 금지
ground_truth: harness
llm_allowed: cite_only
prohibition:
- LLM이 alpha_feedback_json 없이 SAQG 임계값 변경 임의 권고 금지
output:
field: alpha_feedback_json
additional_fields:
- eligible_t20_fail_rate
- eligible_t60_fail_rate
- cases_analyzed
- grade_count
version: 2026-05-21_AFL_V1
owner: quant_team
lifecycle_state: active
input_fields:
- alpha_evaluation_window_json
- saqg_v1
- brt_verdict
- market_regime
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PULLBACK_ENTRY_TRIGGER_V1:
purpose: '뒷박 상태(ANTI_CHASING_VELOCITY BLOCK)에서 풀백 조건이 충족되면 자동 진입 트리거를 생성. "지금
사면 뒷박 → 풀백 기다려 적정 가격에 진입"을 결정론적으로 산출.
'
applicable: ANTI_CHASING_VELOCITY_V1 직후. BLOCK_CHASE 종목에만 적용.
inputs:
- field: velocity_1d
unit: percent
- field: close
unit: KRW_per_share
- field: ma20
unit: KRW_per_share
- field: volume
unit: shares
- field: avg_volume_5d
unit: shares
- field: alpha_lead_score
unit: score_0_100
- field: anti_chasing_status
unit: enum
conditions:
COND_1: velocity_1d < -1.5% (조정 시작 확인)
COND_2: close <= ma20 * 1.02 (이동평균 근접)
COND_3: volume >= avg_volume_5d * 0.7 (거래량 급감 없음)
COND_4: alpha_lead_score >= 70 (기본 품질 유지)
COND_5: anti_chasing_velocity_status != BLOCK_* (속도 차단 해제)
state_machine:
WAIT_PULLBACK: BLOCK_CHASE 상태이나 COND 미충족
PULLBACK_ENTRY_READY: COND 1~5 모두 충족 → T1 체결 허용
STALE_PULLBACK_EXPIRED: entry_date + 15 영업일 초과 → 트리거 만료
expressions:
pullback_trigger_price: max(ma20, prevClose - 0.5 * atr20), tick 정규화
pullback_expiry_date: entry_date + 15 영업일
output:
field: pullback_state
values:
- WAIT_PULLBACK
- PULLBACK_ENTRY_READY
- STALE_PULLBACK_EXPIRED
- NOT_APPLICABLE
additional_fields:
- pullback_trigger_price
- pullback_expiry_date
- conditions_met
ground_truth: harness
llm_allowed: cite_only
prohibition:
- WAIT_PULLBACK 상태에서 LLM이 즉시 BUY 지시 금지
- STALE_PULLBACK_EXPIRED 후 만료된 트리거로 매수 금지
- pullback_trigger_price를 LLM이 재계산 금지
canonical_ref: AGENTS.md:Direction B2, K1
version: 2026-05-22_3RD_HARNESS
owner: quant_team
lifecycle_state: active
input_fields:
- velocity_1d
- close
- ma20
- volume
- avg_volume_5d
- alpha_lead_score
- anti_chasing_status
output_fields:
- pullback_state
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
SELL_EXECUTION_TIMING_V1:
purpose: '장중 가격 움직임에 따라 매도 주문 유형과 타이밍을 결정론적으로 판정. 장초반 패닉 매도, 반등 직전 저점 투매 방지.
'
applicable: SELL_WATERFALL_ENGINE_V1 직후. INTRADAY_ACTION_MATRIX_V1 연동.
inputs:
- field: gap_down_pct
unit: percent
note: (yesterday_close - today_open) / yesterday_close * 100
- field: intraday_drop
unit: percent
note: (today_open - current_price) / today_open * 100
- field: rsi14
unit: score
- field: intraday_change
unit: percent
- field: time_slot_label
unit: enum
note: INTRADAY_ACTION_MATRIX_V1 출력
timing_table:
GAP_DOWN_EMERGENCY:
condition: gap_down_pct > 3
recommended_order_type: MARKET_SELL
note: 장전 갭하락 비상. 지정가 고집 금지.
OVERSOLD_REBOUND:
condition: intraday_drop > 2 AND rsi14 < 35
recommended_order_type: STAGED_SELL_K2
note: K2 단계2 발동. 전량 즉시 매도 금지.
SIDEWAYS_TRIM:
condition: abs(intraday_change) <= 0.5
recommended_order_type: LIMIT_TRIM
note: 강보합 구간 최적 지정가 TRIM.
RALLY_TP:
condition: intraday_change > 1.5
recommended_order_type: TP_LIMIT_SELL
note: 장중 상승 시 TP 지정가 익절 우선. 손절가 주문 취소.
CLOSE_OPTIMAL:
condition: abs(intraday_change) <= 0.5 AND time_slot_label == CLOSE_VERIFY
recommended_order_type: ATR_LIMIT_SELL
note: 종가 근처 ATR 기반 최적 지정가.
output:
field: sell_timing_verdict
additional_fields:
- recommended_order_type
- timing_reason_code
ground_truth: harness
llm_allowed: cite_only
prohibition:
- OVERSOLD_REBOUND 상태에서 전량 즉시 매도 지시 금지
- RALLY_TP 상태에서 손절가 주문 동시 발동 금지
canonical_ref: AGENTS.md:Direction C2, K2, INTRADAY_ACTION_MATRIX_V1
version: 2026-05-22_3RD_HARNESS
owner: quant_team
lifecycle_state: active
input_fields:
- gap_down_pct
- intraday_drop
- rsi14
- intraday_change
- time_slot_label
output_fields:
- sell_timing_verdict
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PORTFOLIO_ALPHA_CONFIDENCE_PER_TICKER_V1:
purpose: '기존 포트폴리오 전체 단일값 PAC(-90.7)를 종목별 분산 PAC로 교체. entry_freshness(35) + breakout_quality(25)
+ flow_accel(20) + fundamental(10) + rs_slope(10) 결합. BULLISH/NEUTRAL/BEARISH
라벨 분산. stddev ≥ 5 강제.
'
output:
field: portfolio_alpha_confidence_per_ticker_v1_json
expected_outputs:
- gate
- stddev
- label_diversity
llm_allowed: cite_only
version: 2026-05-27_PHASE3
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields:
- portfolio_alpha_confidence_per_ticker_v1_json
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
MACRO_EVENT_TICKER_IMPACT_V1:
purpose: 'FOMC·CPI·옵션만기·반도체가이던스·관세 정적 카탈로그 × 종목 섹터 민감도로 impact_score(-100~+100)와
action_gate를 산출한다. 뒷박 차단 5중 AND의 1표(ALEG-V3+DSD-V1+breakout+smart_money+macro_event).
'
output:
file: Temp/macro_event_ticker_impact_v1.json
expected_outputs:
- gate
- ticker_count
- action_summary
llm_allowed: cite_only
version: 2026-05-28_PHASE4
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
PREDICTIVE_ALPHA_REPORT_LOCK_V2:
purpose: 'predictive_alpha_json에서 thesis_signals/antithesis_signals/synthesis_score를
종목별 표로 강제 출력. coverage_pct >= 100% 필요 (ETF 예외 허용 시 >= 80%).
'
output:
file: Temp/predictive_alpha_report_lock_v2.json
expected_outputs:
- gate
- coverage_pct
- missing_tickers
llm_allowed: cite_only
version: 2026-05-28_PHASE5
owner: quant_team
lifecycle_state: active
input_fields: []
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ANTI_LATE_ENTRY_GATE_V2:
purpose: '속도, 거래량, 추세 3개 게이트를 결합해 늦은 추격 진입을 차단한다.
'
input_fields:
- close
- prevClose
- ma20
- volume
- avg_volume_5d
- ret5d
expected_outputs:
- gate
- anti_late_entry_status
llm_allowed: cite_only
version: 2026-05-30_PHASE8
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ANTI_CHASE_V1:
purpose: '뒷북·설거지 진입을 차단하는 velocity 기반 anti-chase 게이트를 산출한다.
'
input_fields:
- velocity_1d
- velocity_5d
- atr_ratio
expected_outputs:
- anti_chase_gate
- chase_risk_level
llm_allowed: cite_only
version: 2026-06-03_ORPHAN_RECONCILE
owner: quant_team
lifecycle_state: active
output_fields: []
missing_policy: DATA_MISSING. 계산 결과를 추정하지 않는다.
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
ENTRY_TIMING_DECILE_FACTOR_V1:
purpose: 뒷박 매수 임계값 하드코딩 제거 — T+5 실측 분포 분위 기반 동적 컷 (Direction LC1)
agents_md_ref: 'Direction LC1: LATE_CHASE_CALIBRATION_LOCK_V1'
inputs:
- field: buy_timing_score
unit: ratio_0_1
note: velocity_1d 실측 미확보 시 proxy 사용
- field: t5_ledger
unit: proposal_evaluation_history records
- field: cut_decile
unit: integer_1_10
optional: true
expression: entry_velocity_decile = ntile(buy_timing_score over t5_ledger, 10);
buy_allowed = entry_velocity_decile > cut_decile
components:
cut_decile_default:
value: 3
calibration_status: EXPERT_PRIOR
note: 하위 3분위 차단. samples>=30 후 실측 최저승률 분위로 자동 교체.
min_samples:
value: 30
unit: records
output:
field: velocity_decile_thresholds
unit: dict
includes:
- decile_1_9_pct
- recommended_block_threshold
- calibration_status
gate:
WATCH_PENDING_SAMPLE: samples < 30
CALIBRATED_FROM_LEDGER: samples >= 30
missing_policy: samples<30이면 EXPERT_PRIOR(buy_timing_score<30) 유지, precision=WATCH_PENDING_SAMPLE
implementation: tools/build_late_chase_attribution_v1.py:NF3
calibration_ref: spec/calibration_registry.yaml:NF3
version: 2026-06-04_NF3
owner: quant_team
lifecycle_state: active
input_fields:
- buy_timing_score
- t5_ledger
- cut_decile
output_fields:
- velocity_decile_thresholds
golden_cases: []
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
GOLDEN_CROSS_SIGNAL_V1:
purpose: >
단기 이동평균(ma20)이 장기 이동평균(ma60)을 상향 돌파하는 골든크로스를 정량 판정한다.
독립 BUY 트리거가 아니라 STRATEGY_SCORING의 component_scores 보조신호로만 사용하며,
BREAKOUT_QUALITY_GATE_V2/ANTI_LATE_ENTRY_GATE_V2를 우회하지 않는다.
(governance/todo/technical_signals_p4_adoption_plan.yaml P4-1, 사용자 제시 전략 01_골든크로스)
applicable: STRATEGY_SCORING 단계. 단독으로 BUY 의사결정 금지.
inputs:
- field: ma20
unit: KRW_per_share
- field: ma20_prev
unit: KRW_per_share
note: 전일 ma20 값.
- field: ma60
unit: KRW_per_share
- field: ma60_prev
unit: KRW_per_share
note: 전일 ma60 값.
expression: >
golden_cross_today = (ma20_prev <= ma60_prev) AND (ma20 > ma60)
output:
field: golden_cross_today
unit: boolean
hard_constraint: golden_cross_today=true는 STRATEGY_SCORING 보조점수 가산 입력일 뿐이며 BUY 게이트 체인을 대체하지 않는다.
missing_policy: ma20_prev 또는 ma60_prev 결측 시 golden_cross_today=null(DATA_MISSING). false로 추정하지 않는다.
canonical_ref: spec/13_formula_registry.yaml:formula_registry.formulas.FLOW_CREDIT_V1
implementation: tools/build_golden_cross_signal_v1.py
owner: quant_team
lifecycle_state: shadow
input_fields:
- ma20
- ma20_prev
- ma60
- ma60_prev
output_fields:
- golden_cross_today
golden_cases:
- golden_cross_basic_detection
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
STRONG_CLOSE_SIGNAL_V1:
purpose: >
종가가 당일 가격 범위(고가-저가) 중 고가 근처에서 마감하는지(강한 종가)를 정량 판정한다.
모멘텀 지속 가능성의 보조신호로만 사용한다.
(governance/todo/technical_signals_p4_adoption_plan.yaml P4-2, 사용자 제시 전략 07_강한종가)
applicable: STRATEGY_SCORING 단계.
inputs:
- field: close_price
unit: KRW_per_share
- field: high_price
unit: KRW_per_share
- field: low_price
unit: KRW_per_share
expression: >
close_position_pct = (close_price - low_price) / (high_price - low_price) * 100 (high==low면 null)
strong_close = close_position_pct >= 80
output:
field: strong_close
unit: boolean
additional_outputs:
- close_position_pct
missing_policy: high_price==low_price(거래정지 등)면 close_position_pct=null, strong_close=null.
canonical_ref: spec/13_formula_registry.yaml:formula_registry.formulas.FLOW_CREDIT_V1
implementation: tools/build_strong_close_signal_v1.py
owner: quant_team
lifecycle_state: shadow
input_fields:
- close_price
- high_price
- low_price
output_fields:
- strong_close
- close_position_pct
golden_cases:
- strong_close_near_high
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
VOLATILITY_EXPANSION_BREAKOUT_V1:
purpose: >
변동성이 수축(bb_width 축소)된 뒤 급등(변동성 확장)하는 패턴을 판정한다. 신규 필드 bb_width
도입. 이 신호 자체는 BUY를 허가하지 않으며 BREAKOUT_QUALITY_GATE_V2 통과를 전제조건으로 한다.
(governance/todo/technical_signals_p4_adoption_plan.yaml P4-3, 사용자 제시 전략 08_변동성확장돌파)
applicable: STRATEGY_SCORING 단계. BREAKOUT_QUALITY_GATE_V2 PASS 후에만 보조신호로 채택.
inputs:
- field: bb_width
unit: percent
note: (상단밴드-하단밴드)/중심선 * 100. 20일 볼린저밴드 기준.
- field: bb_width_20d_percentile
unit: percent
note: 최근 20일 분포 내 현재 bb_width의 백분위. 낮을수록 수축(squeeze) 상태.
- field: ret_1d
unit: percent
expression: >
squeeze_detected = bb_width_20d_percentile <= 20
volatility_expansion_breakout = squeeze_detected_previous_day AND ret_1d >= 3.0
output:
field: volatility_expansion_breakout
unit: boolean
hard_constraint: volatility_expansion_breakout=true이어도 BREAKOUT_QUALITY_GATE_V2 != BLOCKED_LATE_CHASE 조건을 별도로 통과해야 BUY 후보 자격이 생긴다.
missing_policy: bb_width 또는 bb_width_20d_percentile 결측 시 squeeze_detected=null. false로 추정하지 않는다.
canonical_ref: spec/13_formula_registry.yaml:formula_registry.formulas.BREAKOUT_QUALITY_GATE_V2
implementation: tools/build_volatility_expansion_breakout_v1.py
owner: quant_team
lifecycle_state: shadow
input_fields:
- bb_width
- bb_width_20d_percentile
- ret_1d
output_fields:
- volatility_expansion_breakout
golden_cases:
- squeeze_then_expansion
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
FIFTY_TWO_WEEK_HIGH_TRIGGER_V1:
purpose: >
종가가 52주 최고가(High52W)를 갱신하는지 판정해 BREAKOUT_QUALITY_GATE_V2/FOLLOW_THROUGH_DAY_CONFIRM_V1
체인의 입력 신호로 공급한다(기존 필드 High52W를 트리거로 명시적으로 연결).
(governance/todo/technical_signals_p4_adoption_plan.yaml P4-4, 사용자 제시 전략 03_52주신고가)
applicable: STRATEGY_SCORING 단계. 단독 BUY 트리거 금지 — BREAKOUT_QUALITY_GATE_V2 입력으로만 전달.
inputs:
- field: close_price
unit: KRW_per_share
- field: high52w
unit: KRW_per_share
source: spec/12_field_dictionary.yaml:high52w (alias High52W)
expression: >
fifty_two_week_high_breakout = close_price >= high52w
output:
field: fifty_two_week_high_breakout
unit: boolean
hard_constraint: fifty_two_week_high_breakout=true는 BREAKOUT_QUALITY_GATE_V2 입력으로만 전달되며 그 자체로 BUY를 허가하지 않는다.
missing_policy: high52w 결측 시 fifty_two_week_high_breakout=null.
canonical_ref: spec/13_formula_registry.yaml:formula_registry.formulas.BREAKOUT_QUALITY_GATE_V2
implementation: tools/build_fifty_two_week_high_trigger_v1.py
owner: quant_team
lifecycle_state: shadow
input_fields:
- close_price
- high52w
output_fields:
- fifty_two_week_high_breakout
golden_cases:
- high52w_breakout_detection
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
CONSECUTIVE_STREAK_V1:
purpose: >
N일 연속 상승(up_streak)/연속 하락(down_streak)을 대칭적으로 공식화한다.
down_streak는 REBOUND_CAPTURE_THESIS_FACTOR_V1에 하위조건으로 이미 존재하나 up_streak
대응이 없어 비대칭이었다. 이 공식이 단일 출처가 된다.
(governance/todo/technical_signals_p4_adoption_plan.yaml P4-5, 사용자 제시 전략 04_연속상승하락)
applicable: STRATEGY_SCORING 단계, REBOUND_CAPTURE_THESIS_FACTOR_V1 down_streak 입력의 canonical source.
inputs:
- field: daily_close_changes
unit: list_of_percent
note: 최근 N거래일의 일별 종가 변화율(%) 리스트. 최신값이 마지막.
expression: >
up_streak = 마지막 값부터 역순으로 연속 양수(>0)인 일수
down_streak = 마지막 값부터 역순으로 연속 음수(<0)인 일수
output:
field: up_streak
unit: count
additional_outputs:
- down_streak
missing_policy: daily_close_changes 비어있으면 up_streak=down_streak=null.
canonical_ref: spec/13_formula_registry.yaml:formula_registry.formulas.REBOUND_CAPTURE_THESIS_FACTOR_V1
implementation: tools/build_consecutive_streak_v1.py
owner: quant_team
lifecycle_state: shadow
input_fields:
- daily_close_changes
output_fields:
- up_streak
- down_streak
golden_cases:
- up_streak_and_down_streak_symmetry
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation
TREND_FILTER_GATE_V1:
purpose: >
종가가 장기 이동평균(ma120) 위에 있고 ma120 자체가 상승 중인지를 단일 게이트로 공식화한다.
entry_core.yaml:regime_based_entry, ANTI_LATE_ENTRY_GATE_V2의 암묵적 추세 조건을 명시적
단일 공식으로 통합해 LLM이 추세 판정을 임의로 서술하지 않게 한다.
(governance/todo/technical_signals_p4_adoption_plan.yaml P4-7, 사용자 제시 전략 10_추세필터)
applicable: STRATEGY_SCORING 및 PORTFOLIO_CONSTRAINT_CHECK 입력. 단독으로 BUY 허가하지 않음 — HOLD/AVOID 보조 게이트.
inputs:
- field: close_price
unit: KRW_per_share
- field: ma120
unit: KRW_per_share
- field: ma120_prev
unit: KRW_per_share
note: 전일 ma120 값. 상승 여부 판정용.
expression: >
trend_filter_pass = (close_price > ma120) AND (ma120 > ma120_prev)
output:
field: trend_filter_pass
unit: boolean
missing_policy: ma120 또는 ma120_prev 결측 시 trend_filter_pass=null(DATA_MISSING).
canonical_ref: spec/strategy/entry_core.yaml:entry_timing_guardrails.regime_based_entry
implementation: tools/build_trend_filter_gate_v1.py
owner: quant_team
lifecycle_state: shadow
input_fields:
- close_price
- ma120
- ma120_prev
output_fields:
- trend_filter_pass
golden_cases:
- trend_filter_above_rising_ma120
activation_threshold:
min_t20_sample: 30
retirement_condition: performance_degradation