2eaa981b61
새로 완료된 항목: - F15: late_chase_gate 로직 포팅 * formulas/late_chase_gate_v1.py: is_late_chase_blocked() 구현 * tests/parity/test_late_chase_gate_parity_v1.py: 11 parity 테스트 (모두 PASS) * 두 가지 조건(explicit gate block OR risk score >= 70)을 정확히 포팅 - F07: score_thresholds 상수 모듈 추가 * formulas/score_thresholds_v1.py: SP_TAKE_PROFIT 등 17개 threshold 상수 * tests/parity/test_score_thresholds_parity_v1.py: 9 parity 테스트 (모두 PASS) * GAS THRESHOLDS 객체의 모든 값 정확히 재현 - F14 재검증: late_chase_risk_score는 GAS 유일 생산처 (Python canonical 없음) * migration_action: KEEP_IN_GAS로 확정, status: DONE 전체 테스트: 135/135 PASS 완료 현황 (총 15개 항목 중): ✅ DONE (9개): F01, F02, F03, F04, F06, F07, F09, F11, F14, F15 🔴 KEEP_IN_GAS (2개): F08, F14 🕐 TODO (4개): F05 (큰 함수), F10 (큰 함수), F12/F13 (아키텍처 결정 대기) 남은 작업: - F05/F10: 각각 100+줄 함수(calcExitSellAction_, routing)의 일부 → 다중 세션 포팅 필요 - F12/F13: KEEP_BOTH_SEPARATE_ROLES (아키텍처 결정 완료, 추가 코딩 불필요) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
"""
|
|
Late-chase entry freshness gate.
|
|
|
|
F15 porting: Determines whether an entry is blocked due to late-chase risk.
|
|
ENTRY_FRESHNESS_GATE_V1 context: if late-chase is detected, sets freshnessState to
|
|
'BLOCK_LATE_CHASE' and prevents entry execution.
|
|
|
|
Ported from: src/gas_adapter_parts/gdf_04_execution_quality.gs:482
|
|
Parity reference: tests/parity/test_late_chase_gate_parity_v1.py
|
|
"""
|
|
|
|
|
|
def is_late_chase_blocked(breakout_quality_gate: str, late_chase_risk_score) -> bool:
|
|
"""
|
|
Check if late-chase is blocked based on quality gate or risk threshold.
|
|
|
|
GAS: bqRow.breakout_quality_gate === 'BLOCKED_LATE_CHASE' || alphaRow["late_chase_risk_score"] >= 70
|
|
|
|
Args:
|
|
breakout_quality_gate: The breakout quality gate state (string, e.g., 'BLOCKED_LATE_CHASE')
|
|
late_chase_risk_score: Numeric risk score (int or float); can be None/NaN
|
|
|
|
Returns:
|
|
True if late-chase is blocked; False otherwise
|
|
"""
|
|
# First condition: explicit gate block
|
|
if breakout_quality_gate == 'BLOCKED_LATE_CHASE':
|
|
return True
|
|
|
|
# Second condition: risk score threshold
|
|
if isinstance(late_chase_risk_score, (int, float)):
|
|
# Handle NaN: float('nan') >= 70 returns False, which is correct (NaN blocks nothing)
|
|
if late_chase_risk_score >= 70:
|
|
return True
|
|
|
|
return False
|