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>
This commit is contained in:
@@ -852,3 +852,223 @@ formulas:
|
||||
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
|
||||
|
||||
@@ -1544,3 +1544,43 @@ formulas:
|
||||
activation_threshold:
|
||||
min_t20_sample: 30
|
||||
retirement_condition: performance_degradation
|
||||
BREAKOUT_FAILURE_STOP_V1:
|
||||
purpose: >
|
||||
전고점(prior_high)을 돌파한 종목이 며칠 내 다시 그 아래로 이탈하면("돌파 실패") 전용 손절을
|
||||
발동한다. ANTI_WHIPSAW_GATE_V1보다 좁고 구체적인 "돌파 후 재이탈" 패턴 전용 규칙이다.
|
||||
(governance/todo/technical_signals_p4_adoption_plan.yaml P4-6, 사용자 제시 전략 06_돌파실패손절)
|
||||
applicable: EXIT_POLICY_CHECK 단계. 보유 포지션이 돌파 매수로 진입한 경우에만 적용.
|
||||
inputs:
|
||||
- field: prior_high
|
||||
unit: KRW_per_share
|
||||
note: 진입 당시 돌파 기준이 된 전고점.
|
||||
- field: close_price
|
||||
unit: KRW_per_share
|
||||
- field: days_since_breakout
|
||||
unit: trading_days
|
||||
source: spec/13_formula_registry.yaml:formula_registry.formulas.FOLLOW_THROUGH_DAY_CONFIRM_V1
|
||||
expression: >
|
||||
breakout_failure = (days_since_breakout <= 7) AND (close_price < prior_high)
|
||||
output:
|
||||
field: breakout_failure
|
||||
unit: boolean
|
||||
gates:
|
||||
- if: breakout_failure == true
|
||||
action: SELL_RISK_EXIT_REVIEW
|
||||
reason_code: breakout_failure_stop
|
||||
missing_policy: prior_high 또는 days_since_breakout 결측 시 breakout_failure=null. 손절 신호를 임의 추정하지 않는다.
|
||||
canonical_ref: spec/13_formula_registry.yaml:formula_registry.formulas.ANTI_WHIPSAW_GATE_V1
|
||||
implementation: tools/build_breakout_failure_stop_v1.py
|
||||
owner: quant_team
|
||||
lifecycle_state: shadow
|
||||
input_fields:
|
||||
- prior_high
|
||||
- close_price
|
||||
- days_since_breakout
|
||||
output_fields:
|
||||
- breakout_failure
|
||||
golden_cases:
|
||||
- breakout_then_reentry_below_prior_high
|
||||
activation_threshold:
|
||||
min_t20_sample: 30
|
||||
retirement_condition: performance_degradation
|
||||
|
||||
Reference in New Issue
Block a user