feat: 해외주식 미체결 주문 감지 및 처리 (#229) #231

Merged
jihoson merged 1 commits from feature/issue-229-overseas-pending-order-handling into main 2026-02-23 22:00:10 +09:00
Collaborator

Summary

  • OverseasBrokerget_overseas_pending_orders (TTTS3018R, 실전전용 / paper는 [] 반환) 및 cancel_overseas_order (거래소별 TR_ID, hashkey 필수) 추가
  • TelegramClientnotify_unfilled_order 추가 (SELL 미체결=HIGH, BUY 취소=MEDIUM 우선순위)
  • handle_overseas_pending_orders 함수 추가:
    • BUY 미체결 → 취소 + buy_cooldown 설정
    • SELL 미체결 → 취소 후 현재가 기준 -0.4% 재주문 (세션당 최대 1회)
    • 미국 거래소(NASD/NYSE/AMEX) 중복 조회 방지 (NASD 1회만 조회)
  • daily 모드와 realtime 모드 모두 market 루프 시작 전 호출

Test plan

  • pytest tests/test_overseas_broker.py -v -k "Pending or Cancel" → 8 passed
  • pytest tests/test_main.py -v -k "Pending" → 5 passed
  • pytest --cov=src --cov-report=term-missing -q → 845 passed, 78% coverage
  • ruff check — N806 수정 완료, 나머지 기존 pre-existing 이슈

🤖 Generated with Claude Code

## Summary - `OverseasBroker`에 `get_overseas_pending_orders` (TTTS3018R, 실전전용 / paper는 `[]` 반환) 및 `cancel_overseas_order` (거래소별 TR_ID, hashkey 필수) 추가 - `TelegramClient`에 `notify_unfilled_order` 추가 (SELL 미체결=HIGH, BUY 취소=MEDIUM 우선순위) - `handle_overseas_pending_orders` 함수 추가: - BUY 미체결 → 취소 + buy_cooldown 설정 - SELL 미체결 → 취소 후 현재가 기준 -0.4% 재주문 (세션당 최대 1회) - 미국 거래소(NASD/NYSE/AMEX) 중복 조회 방지 (NASD 1회만 조회) - daily 모드와 realtime 모드 모두 market 루프 시작 전 호출 ## Test plan - [x] `pytest tests/test_overseas_broker.py -v -k "Pending or Cancel"` → 8 passed - [x] `pytest tests/test_main.py -v -k "Pending"` → 5 passed - [x] `pytest --cov=src --cov-report=term-missing -q` → 845 passed, 78% coverage - [x] `ruff check` — N806 수정 완료, 나머지 기존 pre-existing 이슈 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agentson added 1 commit 2026-02-23 21:12:50 +09:00
feat: 해외주식 미체결 주문 감지 및 처리 (#229)
Some checks failed
CI / test (pull_request) Has been cancelled
6b74e4cc77
- OverseasBroker에 get_overseas_pending_orders (TTTS3018R, 실전전용)
  및 cancel_overseas_order (거래소별 TR_ID, hashkey 필수) 추가
- TelegramClient에 notify_unfilled_order 추가
  (BUY취소=MEDIUM, SELL미체결=HIGH 우선순위)
- handle_overseas_pending_orders 함수 추가:
  · BUY 미체결 → 취소 + 쿨다운 설정
  · SELL 미체결 → 취소 후 -0.4% 재주문 (최대 1회)
  · 미국 거래소(NASD/NYSE/AMEX) 중복 조회 방지
- daily/realtime 두 모드 모두 market 루프 시작 전 호출
- 테스트 13개 추가 (test_overseas_broker.py 8개, test_main.py 5개)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jihoson merged commit 8a8ba3b0cb into main 2026-02-23 22:00:10 +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#231