# Live Timing Engine Rules

## Purpose

Convert live or near-live market data into intuitive buy/sell timing labels.

The engine is not an order executor. It is a decision-support layer.

User-facing reports should display Korean labels first and keep English codes only in parentheses when useful. Use `/Users/jangbogeun/Documents/Codex/2026-06-06/2/outputs/korean_reporting_terminology_guide.md`.

## Inputs

- Public quote/history from yfinance.
- Broker quote and broker FX should override public data for actual order sizing.
- Tickers: indexes, semiconductor ETFs, SOXL/SOXS, leaders, and current holdings.

Default watchlist:

- SPY, QQQ, IWM.
- SMH, SOXX, SOXL, SOXS.
- NVDA, AVGO, AMD, MU, TSM, ASML.
- RDW, MRVL, AAOI, GNTA.
- NASA still requires exact ticker confirmation.

## Indicators

- Current or latest available price.
- Previous close and day change.
- SMA20, SMA50, SMA200.
- RSI14.
- ATR14 percent.
- Volume ratio versus recent average.
- Intraday VWAP approximation when 5-minute data is available.

## Timing Labels

- `BUY SETUP`: 매수 가능.
- `BUY SETUP - DO NOT CHASE`: 매수 후보지만 추격 금지.
- `REBOUND WATCH`: 반등 감시.
- `INVERSE BUY SETUP`: 인버스 매수 후보.
- `TRIM WATCH`: 일부 축소 감시.
- `EXIT WATCH`: 이탈/청산 감시.
- `NO EDGE`: 우위 없음.
- `DATA NEEDED`: 데이터 필요.

## Action Labels

- `ATTACK`: 공격.
- `DEFEND`: 방어.
- `HARVEST`: 수익실현.
- `WAIT`: 대기.

## Required Use

Before any live trade recommendation:

1. Run the live timing engine or equivalent live data check.
2. Confirm account mode: ATTACK, GUARDED ATTACK, DEFENSE, or REST.
3. Confirm broker orderable cash and account eligibility.
4. Confirm target 1, target 2, stop/invalidation, time stop, and max loss KRW.
5. For SOXL/SOXS, verify main-account-only and fresh USD/KRW.

## Command

```bash
python3 outputs/live_market_timing_engine.py --tickers QQQ SMH SOXL SOXS AMD MU RDW MRVL AAOI
```

JSON mode:

```bash
python3 outputs/live_market_timing_engine.py --json
```

## Output Files

- `/Users/jangbogeun/Documents/Codex/2026-06-06/2/outputs/live_timing_snapshot.md`
- `/Users/jangbogeun/Documents/Codex/2026-06-06/2/outputs/live_timing_snapshot.csv`
- `/Users/jangbogeun/Documents/Codex/2026-06-06/2/outputs/live_timing_snapshot.json`
