- scripts/_is_trading_day.py 신규: 한국 공휴일+대체공휴일 판단 (exit 0=거래일, 1=휴장)
* holidays.SouthKorea() 기반, 제헌절(7/17) 오탐 제외 처리
- run_morning/midday/evening/bot.ps1: 스크립트 상단에 공휴일 체크 추가
* 휴장일이면 로그 기록 후 즉시 종료 (Claude/봇 미실행)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- OHLCV 조회를 단일일→7일 범위로 변경해 공휴일(대체공휴일 등) 자동 처리
(5/25 대체공휴일로 전 종목 목표가 0개 → 오늘 하루 종일 0건 원인)
- 목표가 계산 결과 DEBUG→INFO 레벨 격상 (종목별 목표가·시가 표시)
- 목표가 제외 이유 INFO 로그 추가 (전일 데이터 없음 / 거래대금 미달)
- check_entries에 5분마다 진단 로그 추가 (신호 거절 이유 전 종목 출력)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1. evening.py MDD: peak=0 초기값 문제로 분모가 1이 되어 수천만% 출력
→ 초기자본(10,000,000) 기준 % 계산으로 변경
2. kis_client.py _request: ClientTimeout 미설정으로 SSL 연결이 무한 대기
→ total=10초 타임아웃 적용, 세마포 타임아웃 오류 방지
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- L3 하드 중단 제거 → B안(연속 손절별 포지션 축소) 적용
0회×1.0 / 1회×0.7 / 2회×0.5 / 3+회×0.3, 익절 시 한 단계 회복
- 아침·점심 세션 분리: 11:00 이후 midday_context.json 감지 시 점심 세션 자동 시작
(12:00 고정 시작 제거 → 이벤트 기반)
- app/ai/midday.py: 장중 데이터 수집 스크립트 신규 작성
- .claude/commands/midday.md: /midday 슬래시 커맨드 신규 작성
- scripts/run_midday.ps1: 11:20 스케줄러 스크립트 신규 작성
- setup_scheduler.ps1: StockBot_Midday 태스크 추가
- CLAUDE.md: 전체 문서 업데이트
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- get_foreign_institution_rank: FHKST04430000(없는 서비스) → FHPTJ04400000(foreign-institution-total)
- get_sector_trend: FHKST03010100(일봉 오용) → FHPUP02100000(inquire-index-price) 15개 업종 다중 호출
- 두 함수 모두 실거래 API 테스트 통과 확인
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
StockBot_Bot 스케줄러(07:55) 비활성화.
run_morning.ps1이 /morning 완료 후 /start-bot 실행.
daily_context.json 생성 보장 후 봇 시작으로 컨텍스트 적용 확인 가능.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
재시작 간격이 짧을 때 발생하는 EGW00133(1분당 1회 제한) 오류를 방지하기 위해
토큰을 data/kis_token_{mode}.json에 저장하고 재시작 시 유효 토큰을 재사용한다.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- order_executor: _update_trade_exit에 pnl 계산 저장 추가
- main: 매수 시 positions DB INSERT, 매도 시 DELETE
- main: 재시작 시 DB에서 positions 복원 (_restore_positions_from_db)
- ~/.claude/commands/start-bot.md: /start-bot 슬래시 커맨드 추가
(DETACHED_PROCESS로 Python 봇 백그라운드 실행 + Discord 알림)
- scripts/run_bot.ps1: python 직접 실행 → claude -p "/start-bot" 로 변경
- scripts/setup_scheduler.ps1: 3개 태스크 통합 재등록 스크립트 업데이트
- StockBot_Bot 태스크 업데이트 완료
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- app/ai/evening.py: 장후 데이터 수집 (매매내역/30일통계/실전전환조건)
- ~/.claude/commands/evening.md: /evening 슬래시 커맨드
- scripts/run_evening.ps1: claude_evening 실행 스크립트
- 작업 스케줄러 StockBot_Evening 등록 (평일 15:30)
- .claude/settings.json: bypassPermissions 추가 (권한 영구 승인)
- CLAUDE.md: 권한 섹션 추가, 할 일 목록 업데이트
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- scripts/run_morning.ps1: claude_morning 실행 스크립트
- scripts/run_bot.bat: 매매봇 실행 스크립트
- scripts/setup_scheduler.ps1: 작업 스케줄러 등록 스크립트
- app/main.py: AI 컨텍스트 로드 타이밍 08:05→08:30으로 수정
(claude_morning이 08:15 시작해 08:30 전에 완료되므로)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- SessionStart 훅: git HEAD를 session_start_sha.txt에 저장
- discord_notify.py: 세션 시작 이후 커밋만 표시 (누적 방지)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- morning.py: AI 분석 제거, 데이터 수집 전용으로 단순화
(뉴스 크롤링 + KIS 수급 수집 → 파일 저장)
- main.py: morning 관련 잘못된 연결 제거
- requirements.txt: anthropic 제거 (Claude Code 자체가 AI)
- ~/.claude/commands/morning.md: /morning 슬래시 커맨드 추가
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- app/ai/morning.py: 장전 분석 스크립트 신규 추가
- 네이버 금융 뉴스 크롤링 (BeautifulSoup) → data/news/날짜.json
- KIS API 거래량순위/외국인수급/업종동향 수집 → data/market/날짜.json
- Claude AI 분석 → data/daily_context.json 생성
- Discord 분석 요약 전송
- app/main.py: 08:30 타임슬롯에 claude_morning 연결
- app/requirements.txt: anthropic>=0.40.0 추가
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- .claude/discord_notify.py: 세션 종료 시 git log/status를 Discord로 전송
- .claude/settings.json: Stop 훅 등록
- notifier.py: Cloudflare 차단 방지를 위해 User-Agent 헤더 추가
- .gitignore: settings.local.json 제외
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- main.py: sleep 0.05/0.1 → 1.1초 (KIS rate limit 준수)
- main.py: 전일 날짜 계산 수정 (월요일→금요일), 인라인 주석 env 파싱, 장 중 재시작 즉시 루프 진입
- strategy/volatility_breakout.py: has_prev_data() 추가, 중복 수집 skip
- db/repository.py, order_executor.py: UPDATE ORDER BY → 서브쿼리 수정 (SQLite 호환)
- kis_client.py: get_balance TR ID VTTC8001R → VTTC8434R
- test_connection.py: API 호출 간 sleep 추가
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>