# Backtesting And Expected Profit Automation Rules

## Purpose

주기적으로 전략이 실제로 순수익을 만들 가능성이 있는지 점검하고, 원화 기준 기대 순수익을 계산한다.

## Backtesting Cadence

- Daily quick check: 전일 시장 국면과 현재 포지션의 간단한 expected value 업데이트.
- Weekly backtest: 최근 1년 rolling window와 10년 국면 보정.
- Monthly validation: 전략별 out-of-sample 검증, 편향 점검, 과적합 경고.
- Event-driven test: 관세, 금리 쇼크, AI 버블, 지정학, 실적 쇼크 발생 시 유사 국면 비교.

## Required Metrics

각 전략은 아래 지표를 갖는다.

- CAGR
- median_return
- p10_return
- p90_return
- max_drawdown
- worst_5pct_outcome
- recovery_days
- hit_rate
- average_win
- average_loss
- payoff_ratio
- expected_profit_krw
- expected_net_profit_krw_after_tax_fx_cost
- x2_probability
- quest_success_probability

## Strategy Families

기본 비교군:

- cash_wait
- buy_and_hold_core
- guarded_attack_barbell
- tactical_rebound_hold
- long_short_market_neutral
- semi_momentum_soxl
- semi_breakdown_soxs
- dividend_income_after_1b

## Bias Guard

백테스트는 항상 아래 경고를 출력한다.

- 생존편향 가능성
- 선견편향 가능성
- 데이터스누핑 가능성
- 과적합 가능성
- 거래비용/세금/환율 누락 여부
- 샘플 수 부족 여부
- 특정 구간 의존 여부

## Output Format

```text
BACKTEST_SUMMARY
period:
regime:
best_net_profit_strategy:
expected_net_profit_krw:
max_drawdown:
worst_case:
bias_warnings:
recommended_allocation:
cash_level:
long_short_balance:
action:
```

## Decision Rule

평균수익률이 높은 전략이 아니라, 아래 순서로 채택한다.

1. 원화 기준 순수익
2. 최대낙폭
3. 손실 꼬리
4. 회복기간
5. 실행 가능성
6. 피로도 비용
7. 세후 기대값

## Dividend Phase

계좌별 순자산 10억 KRW 미만에서는 배당 전략을 기본 성장 전략으로 채택하지 않는다. 배당 ETF는 관찰 또는 방어 보조로만 둔다.
