Implement status query commands (/status, /positions) #67

Closed
opened 2026-02-05 15:28:41 +09:00 by agentson · 0 comments
Collaborator

목표

상태 조회 명령어 /status와 /positions 구현

세부사항

  • /status: 현재 거래 상태 (모드, 활성 마켓, P&L 등)
  • /positions: 현재 보유 종목 조회
  • Broker API 및 RiskManager와 연동

구현 내용

/status 응답 형식

📊 Trading Status

Mode: PAPER
Markets: Korea, United States
Trading: Active / Paused

Current P&L: +2.5%
Circuit Breaker: -3.0%

/positions 응답 형식

💼 Current Holdings

🇰🇷 Korea
• 005930 (Samsung): 10 shares @ ₩70,000
• 035420 (NAVER): 5 shares @ ₩200,000

🇺🇸 United States
• AAPL: 15 shares @ $175.50
• TSLA: 8 shares @ $245.00

Total Value: ₩5,250,000 + $4,158.00

기술적 고려사항

/status 구현

  • settings에서 MODE, enabled_markets 가져오기
  • pause_trading.is_set()로 거래 상태 확인
  • RiskManager에서 현재 P&L 조회
  • Circuit breaker threshold 표시

/positions 구현

  • Broker.get_balance()로 계좌 잔고 조회
  • 마켓별로 포지션 그룹화
  • 종목명, 수량, 평균가 표시
  • 에러 처리: API 실패시 적절한 메시지

체크리스트

  • /status 핸들러 구현
  • /positions 핸들러 구현
  • Broker API 연동
  • RiskManager 연동
  • 테스트 추가
  • 커버리지 80% 이상 유지

의존성

  • Depends on #65 (trading control commands)

관련 이슈

Part of Telegram bidirectional command feature implementation

## 목표 상태 조회 명령어 /status와 /positions 구현 ## 세부사항 - /status: 현재 거래 상태 (모드, 활성 마켓, P&L 등) - /positions: 현재 보유 종목 조회 - Broker API 및 RiskManager와 연동 ## 구현 내용 ### /status 응답 형식 ``` 📊 Trading Status Mode: PAPER Markets: Korea, United States Trading: Active / Paused Current P&L: +2.5% Circuit Breaker: -3.0% ``` ### /positions 응답 형식 ``` 💼 Current Holdings 🇰🇷 Korea • 005930 (Samsung): 10 shares @ ₩70,000 • 035420 (NAVER): 5 shares @ ₩200,000 🇺🇸 United States • AAPL: 15 shares @ $175.50 • TSLA: 8 shares @ $245.00 Total Value: ₩5,250,000 + $4,158.00 ``` ## 기술적 고려사항 ### /status 구현 - settings에서 MODE, enabled_markets 가져오기 - pause_trading.is_set()로 거래 상태 확인 - RiskManager에서 현재 P&L 조회 - Circuit breaker threshold 표시 ### /positions 구현 - Broker.get_balance()로 계좌 잔고 조회 - 마켓별로 포지션 그룹화 - 종목명, 수량, 평균가 표시 - 에러 처리: API 실패시 적절한 메시지 ## 체크리스트 - [ ] /status 핸들러 구현 - [ ] /positions 핸들러 구현 - [ ] Broker API 연동 - [ ] RiskManager 연동 - [ ] 테스트 추가 - [ ] 커버리지 80% 이상 유지 ## 의존성 - Depends on #65 (trading control commands) ## 관련 이슈 Part of Telegram bidirectional command feature implementation
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#67