GT MTF 프로필·캘리브레이션과 04 매칭/시뮬/실거래 파이프라인을 추가한다.
3분~일봉 GT 타점 분석(03c), leg 체결 순서 수정, 총자산 90% 검증 루프, walk-forward Go/No-Go 시뮬, monitor·live_trader 및 reference 문서를 포함한다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,31 +1,44 @@
|
||||
"""
|
||||
04단계 스텁: GT 스냅샷과 현재 상태 유사도·규칙 후보 (구현 예정).
|
||||
04단계: GT 프로필 + 전구간 EV 필터 매칭 파이프라인.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from deepcoin.paths import REPORTS_ANALYSIS, REPORTS_MATCHING, resolve_ground_truth_file
|
||||
from deepcoin.matching.pipeline import run_matching_pipeline
|
||||
from deepcoin.paths import ANALYSIS_TRADES_CSV, REPORTS_ANALYSIS, REPORTS_MATCHING
|
||||
|
||||
|
||||
def run_match(
|
||||
phase: str = "all",
|
||||
trades_csv: Path | None = None,
|
||||
) -> None:
|
||||
"""
|
||||
04 파이프라인 실행.
|
||||
|
||||
Args:
|
||||
phase: all | profile | scan | label | select.
|
||||
trades_csv: 03b CSV 경로(선택).
|
||||
"""
|
||||
REPORTS_MATCHING.mkdir(parents=True, exist_ok=True)
|
||||
csv = trades_csv or ANALYSIS_TRADES_CSV
|
||||
if not csv.is_file():
|
||||
raise FileNotFoundError(
|
||||
f"03b CSV 없음: {csv}\n python scripts/03_analyze_trades.py 먼저 실행"
|
||||
)
|
||||
run_matching_pipeline(phase=phase, trades_csv=csv)
|
||||
|
||||
|
||||
def run_match_stub() -> Path:
|
||||
"""
|
||||
입력 파일 존재 여부만 확인하고 04단계 안내를 출력합니다.
|
||||
|
||||
Returns:
|
||||
matching 리포트 디렉터리.
|
||||
"""
|
||||
REPORTS_MATCHING.mkdir(parents=True, exist_ok=True)
|
||||
gt = resolve_ground_truth_file()
|
||||
csv = REPORTS_ANALYSIS / "general_analysis_trades.csv"
|
||||
print("=== Phase 04 Matching (stub) ===")
|
||||
print(f" ground truth: {gt} ({'OK' if gt.is_file() else 'MISSING'})")
|
||||
print(f" analysis csv: {csv} ({'OK' if csv.is_file() else 'MISSING — run scripts/03_analyze_trades.py'})")
|
||||
"""하위 호환: 스텁 대신 phase=profile만 안내."""
|
||||
print("=== Phase 04 Matching ===")
|
||||
print(" 전체 파이프라인: python scripts/04_match_rules.py")
|
||||
print(" 단계별: --phase profile|scan|label|select")
|
||||
print(f" analysis csv: {ANALYSIS_TRADES_CSV}")
|
||||
print(f" output dir: {REPORTS_MATCHING}")
|
||||
print(" 구현 예정: 유사도·규칙 선택")
|
||||
return REPORTS_MATCHING
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_match_stub()
|
||||
run_match()
|
||||
|
||||
Reference in New Issue
Block a user