Files
QuantEngineByItz/tests/golden/generated/breakout_failure_stop_v1_golden.py
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

36 lines
1.1 KiB
Python

"""Golden tests for BREAKOUT_FAILURE_STOP_V1 (governance/todo/technical_signals_p4_adoption_plan.yaml P4-6)."""
from __future__ import annotations
import importlib.util
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
MODULE_PATH = ROOT / "tools" / "build_breakout_failure_stop_v1.py"
def _load_module():
spec = importlib.util.spec_from_file_location("build_breakout_failure_stop_v1", MODULE_PATH)
module = importlib.util.module_from_spec(spec)
assert spec.loader is not None
spec.loader.exec_module(module)
return module
def test_reentry_below_prior_high_within_window_triggers_sell_review() -> None:
mod = _load_module()
result = mod.evaluate(100, 95, 3)
assert result["breakout_failure"] is True
assert result["gate"] == "SELL_RISK_EXIT_REVIEW"
def test_reentry_after_window_does_not_trigger() -> None:
mod = _load_module()
result = mod.evaluate(100, 95, 10)
assert result["breakout_failure"] is False
def test_missing_prior_high_returns_null() -> None:
mod = _load_module()
result = mod.evaluate(None, 95, 3)
assert result["breakout_failure"] is None