feat: US market code 정합성, Telegram 명령 4종, 손절 모니터링 (#132) #135

Merged
jihoson merged 1 commits from feature/issue-132-us-market-telegram-gaps into main 2026-02-16 20:25:43 +09:00
Collaborator

Summary

  • US Market Code 정합성: MARKET_SHORTHAND + expand_market_codes()로 config "US" → schedule "US_NASDAQ"/"US_NYSE"/"US_AMEX" 자동 확장. evolution 루프 startswith("US") 수정
  • Telegram 명령 4종 추가: /report (일일 리포트), /scenarios (플레이북 시나리오), /review (스코어카드), /dashboard (URL/상태)
  • price_change_pct 주입: trading_cycle()run_daily_session() 양쪽에서 국내(prdy_ctrt)/해외(rate) 추출하여 market_data에 포함
  • HOLD시 손절 모니터링: get_open_position() 기반으로 미청산 포지션 손실률이 stop_loss_pct 이하이면 자동 SELL 오버라이드
  • 대시보드 동적 market 조회: hardcoded ["KR", "US"] → DB UNION 쿼리로 변경

Test plan

  • tests/test_market_schedule.py — expand_market_codes 5개 케이스
  • tests/test_telegram_commands.py — 4개 신규 명령 테스트
  • tests/test_main.py — evolution US 체크, 손절 오버라이드, price_change_pct 검증
  • tests/test_db.py — get_open_position 3개 케이스
  • tests/test_dashboard.py — 동적 market 조회 검증
  • 전체 551 테스트 통과, ruff lint 통과

Closes #132

🤖 Generated with Claude Code

## Summary - **US Market Code 정합성**: `MARKET_SHORTHAND` + `expand_market_codes()`로 config `"US"` → schedule `"US_NASDAQ"/"US_NYSE"/"US_AMEX"` 자동 확장. evolution 루프 `startswith("US")` 수정 - **Telegram 명령 4종 추가**: `/report` (일일 리포트), `/scenarios` (플레이북 시나리오), `/review` (스코어카드), `/dashboard` (URL/상태) - **price_change_pct 주입**: `trading_cycle()`과 `run_daily_session()` 양쪽에서 국내(prdy_ctrt)/해외(rate) 추출하여 market_data에 포함 - **HOLD시 손절 모니터링**: `get_open_position()` 기반으로 미청산 포지션 손실률이 stop_loss_pct 이하이면 자동 SELL 오버라이드 - **대시보드 동적 market 조회**: hardcoded `["KR", "US"]` → DB UNION 쿼리로 변경 ## Test plan - [x] `tests/test_market_schedule.py` — expand_market_codes 5개 케이스 - [x] `tests/test_telegram_commands.py` — 4개 신규 명령 테스트 - [x] `tests/test_main.py` — evolution US 체크, 손절 오버라이드, price_change_pct 검증 - [x] `tests/test_db.py` — get_open_position 3개 케이스 - [x] `tests/test_dashboard.py` — 동적 market 조회 검증 - [x] 전체 551 테스트 통과, ruff lint 통과 Closes #132 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agentson added 1 commit 2026-02-16 20:24:32 +09:00
feat: US market code 정합성, Telegram 명령 4종, 손절 모니터링 (#132)
Some checks failed
CI / test (pull_request) Has been cancelled
3fdb7a29d4
- MARKET_SHORTHAND + expand_market_codes()로 config "US" → schedule "US_NASDAQ/NYSE/AMEX" 자동 확장
- /report, /scenarios, /review, /dashboard 텔레그램 명령 추가
- price_change_pct를 trading_cycle과 run_daily_session에 주입
- HOLD시 get_open_position 기반 손절 모니터링 및 자동 SELL 오버라이드
- 대시보드 /api/status 동적 market 조회로 변경

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jihoson merged commit 0424c78f6c into main 2026-02-16 20:25:43 +09:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#135